[svn:parrot] r43118 - branches/pmc_freeze_cleanup/src
darbelo at svn.parrot.org
darbelo at svn.parrot.org
Thu Dec 17 04:43:07 UTC 2009
Author: darbelo
Date: Thu Dec 17 04:43:07 2009
New Revision: 43118
URL: https://trac.parrot.org/parrot/changeset/43118
Log:
Fix the segfault in examples/benchmarks/freeze.pasm by ensuring that aggregates with no elements still get some space allocated at buffer creation.
Modified:
branches/pmc_freeze_cleanup/src/pmc_freeze.c
Modified: branches/pmc_freeze_cleanup/src/pmc_freeze.c
==============================================================================
--- branches/pmc_freeze_cleanup/src/pmc_freeze.c Thu Dec 17 04:01:21 2009 (r43117)
+++ branches/pmc_freeze_cleanup/src/pmc_freeze.c Thu Dec 17 04:43:07 2009 (r43118)
@@ -1098,7 +1098,7 @@
if (!PMC_IS_NULL(pmc)
&& (VTABLE_does(interp, pmc, array) || VTABLE_does(interp, pmc, hash))) {
- const INTVAL items = VTABLE_elements(interp, pmc);
+ const INTVAL items = VTABLE_elements(interp, pmc) || 1;
/* TODO check e.g. first item of aggregate and estimate size */
len = items * FREEZE_BYTES_PER_ITEM;
}
More information about the parrot-commits
mailing list