Update of /cvsroot/monetdb/pathfinder/compiler/mem
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv6402/mem

Modified Files:
        array.c 
Log Message:
-- Fix in array: When increasing the size of a ``cleared'' array we may only
                 clear the new chunk of memory.


Index: array.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/mem/array.c,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -d -r1.27 -r1.28
--- array.c     17 Mar 2008 17:41:24 -0000      1.27
+++ array.c     18 Mar 2008 16:52:17 -0000      1.28
@@ -161,7 +161,9 @@
       a->base = PFrealloc (a->base, a->bound*a->esize, nbytes);
 
       if (a->clear)
-          memset (a->base, 0, nbytes);
+          memset ((void*)((char*) a->base + (a->bound*a->esize)),
+                  0,
+                  nbytes - (a->bound*a->esize));
 
       a->bound = nbytes / a->esize;
   }


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Monetdb-pf-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-pf-checkins

Reply via email to