Ticket #757: TRAC-757-3.patch

File TRAC-757-3.patch, 1.1 KB (added by kyle_l5l, 12 years ago)

correct n_vtable_max in the cloned interpreter

  • src/pmc/parrotinterpreter.pmc

    old new  
    9090                PObj_is_class_TEST(s->vtables[i]->pmc_class)) { 
    9191                STRING * const class_name = 
    9292                    VTABLE_get_string(s, s->vtables[i]->pmc_class); 
    93                 PARROT_ASSERT(VTABLE_exists_keyed_str(d, 
    94                     d->class_hash, class_name)); 
    95  
    96                 VTABLE_delete_keyed_str(d, d->class_hash, class_name); 
    97  
    98                 if (last_remove == i + 1) { 
    99                     --d->n_vtable_max; 
    100                     last_remove = i; 
    101                 } 
     93                if (VTABLE_exists_keyed_str(d, d->class_hash, class_name)){ 
     94                     VTABLE_delete_keyed_str(d, d->class_hash, class_name); 
     95                      
     96                     if (last_remove == i + 1) { 
     97                          --d->n_vtable_max; 
     98                          last_remove = i; 
     99                     } 
     100                } 
    102101            } 
    103102        } 
     103        d->n_vtable_max = start; // prevent hole between start and s->vtablemax 
    104104    } 
    105105 
    106106    if (flags & PARROT_CLONE_LIBRARIES) {