Update of /cvsroot/monetdb/pathfinder/compiler/mil
In directory sc8-pr-cvs16:/tmp/cvs-serv8241/compiler/mil

Modified Files:
        milprint_summer.c 
Log Message:

new day new lesson:
When replacing alloca in a loop be malloc/realloc,
make sure that you do not forget/overwrite
the origin of the (m|re)alloc'ed buf-fer;
this should keep MonetDB?XQuery from segfaulting
(e.g.) when loading an XQuery module

(
new day, still the old lesson:
testing (would have) found this problem
)


Index: milprint_summer.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/mil/milprint_summer.c,v
retrieving revision 1.370
retrieving revision 1.371
diff -u -d -r1.370 -r1.371
--- milprint_summer.c   2 May 2007 08:35:42 -0000       1.370
+++ milprint_summer.c   2 May 2007 21:15:18 -0000       1.371
@@ -11154,13 +11154,13 @@
             }
             nme = buf;
             if (strchr(tpe, ':') == NULL)  {
-                *buf++ = 'x'; 
-                *buf++ = 's'; 
-                *buf++ = ':'; 
+                *nme++ = 'x'; 
+                *nme++ = 's'; 
+                *nme++ = ':'; 
             }
-            strcpy(buf, tpe);
-            buf = strchr(nme, ' ');
-            if (buf) *buf = 0;
+            strcpy(nme, tpe);
+            nme = strchr(buf, ' ');
+            if (nme) *nme = 0;
 
             assert (L(args) && L(args)->kind == c_param);
             assert (LR(args) && LR(args)->kind == c_var);
@@ -11174,7 +11174,7 @@
 
             if (first == 0) first = vid;
             strncat(sig, ",", 1024);
-            strncat(sig, nme, 1024);
+            strncat(sig, buf, 1024);
 
             args = R(args);
         }


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Monetdb-pf-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-pf-checkins

Reply via email to