Ticket #1295: tt_1295.patch

File tt_1295.patch, 1.0 KB (added by whiteknight, 12 years ago)

patch to implement nested array autovivification on fixedpmcarray

  • src/pmc/fixedpmcarray.pmc

     
    484484        else { 
    485485            PMC *box = SELF.get_pmc_keyed_int(k); 
    486486 
    487             /* RT #46675: autovivify an Array and insert it in SELF */ 
    488             if (!box) 
     487            if (!box) { 
    489488                box = pmc_new(INTERP, SELF.type()); 
     489                SELF.set_pmc_keyed_int(k, box); 
     490            } 
    490491 
    491492            VTABLE_set_number_keyed(INTERP, box, nextkey, value); 
    492493        } 
     
    572573        else { 
    573574            PMC *box = SELF.get_pmc_keyed_int(k); 
    574575 
    575             /* RT #46675: autovivify an Array and insert it in SELF */ 
    576             if (!box) 
     576            if (!box) { 
    577577                box = pmc_new(INTERP, SELF.type()); 
     578                VTABLE_set_pmc_keyed_int(INTERP, SELF, k, box); 
     579            } 
    578580 
    579581            VTABLE_set_pmc_keyed(INTERP, box, nextkey, value); 
    580582        }