Changeset: 49670ad68159 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=49670ad68159
Modified Files:
        MonetDB5/src/modules/mal/bbp.mx
Branch: Oct2010
Log Message:

Set count and capacity *after* the heaps have been allocated.
When setting before, the free pointer of the heap is set to *way*
beyond the size of the heap which may cause out-of-bounds errors
during the call to BBPreleaseref.


diffs (21 lines):

diff -r 3af67c70cb24 -r 49670ad68159 MonetDB5/src/modules/mal/bbp.mx
--- a/MonetDB5/src/modules/mal/bbp.mx   Sat Oct 09 14:38:34 2010 +0200
+++ b/MonetDB5/src/modules/mal/bbp.mx   Sat Oct 09 14:40:59 2010 +0200
@@ -667,8 +667,6 @@
                bn->H->shift = b->H->shift;
                bn->T->width = b->T->width;
                bn->T->shift = b->T->shift;
-               BATsetcapacity(bn, BATcount(b));
-               BATsetcount(bn, BATcount(b));
 
                if (b->H->type)
                        decomp += 
CMDdecompressheap(&b->H->heap,&bn->H->heap,*fnme);
@@ -689,6 +687,8 @@
                        BBPkeepref(*ret = b->batCacheid);
                        return MAL_SUCCEED;
                }
+               BATsetcapacity(bn, BATcount(b));
+               BATsetcount(bn, BATcount(b));
                BATsetaccess(bn, b->P->restricted);
                BBPreleaseref(b->batCacheid);
                BBPkeepref(*ret = bn->batCacheid);
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to