Ticket #757: TRAC-757-1.patch
File TRAC-757-1.patch, 1.8 KB (added by cdarroch, 12 years ago) |
---|
-
src/pmc.c
old new 675 675 const INTVAL type_id = interp->n_vtable_max++; 676 676 677 677 /* Have we overflowed the table? */ 678 if (type_id > =interp->n_vtable_alloced)678 if (type_id > interp->n_vtable_alloced) 679 679 parrot_realloc_vtables(interp); 680 680 681 681 return type_id; -
src/vtables.c
old new 129 129 parrot_alloc_vtables(PARROT_INTERP) 130 130 { 131 131 ASSERT_ARGS(parrot_alloc_vtables) 132 PARROT_ASSERT(enum_class_core_max <= PARROT_MAX_CLASSES); 133 132 134 interp->vtables = mem_allocate_n_zeroed_typed(PARROT_MAX_CLASSES, VTABLE *); 133 135 interp->n_vtable_max = enum_class_core_max; 134 interp->n_vtable_alloced = PARROT_MAX_CLASSES - 1;136 interp->n_vtable_alloced = PARROT_MAX_CLASSES; 135 137 } 136 138 137 139 /* … … 155 157 const INTVAL new_size = new_max * sizeof (VTABLE *); 156 158 const INTVAL old_size = interp->n_vtable_max * sizeof (VTABLE *); 157 159 158 /* arrays start at zero, but we compare type numbers starting at 1 */ 159 interp->n_vtable_alloced = new_max - 1; 160 interp->n_vtable_alloced = new_max; 160 161 interp->vtables = (VTABLE **)mem_sys_realloc_zeroed( 161 162 interp->vtables, new_size, old_size); 162 163 } -
src/pmc/parrotinterpreter.pmc
old new 80 80 d->class_hash = Parrot_clone(d, s->class_hash); 81 81 d->n_vtable_max = s->n_vtable_max; 82 82 83 if(d->n_vtable_max > d->n_vtable_alloced)83 while (d->n_vtable_max > d->n_vtable_alloced) 84 84 parrot_realloc_vtables(d); 85 85 86 86 last_remove = s->n_vtable_max;