Mercurial > projects > ddmd
comparison dmd/SwitchStatement.d @ 180:0622fff7810a
Fixed a few memory allocation related issues
author | korDen |
---|---|
date | Sun, 17 Oct 2010 23:23:28 +0400 |
parents | e3afd1303184 |
children | 190ba98276b3 |
comparison
equal
deleted
inserted
replaced
179:cd48cb899aee | 180:0622fff7810a |
---|---|
485 string = 0; | 485 string = 0; |
486 block_appendexp(mystate.switchBlock, econd); | 486 block_appendexp(mystate.switchBlock, econd); |
487 block_next(blx,BCswitch,null); | 487 block_next(blx,BCswitch,null); |
488 | 488 |
489 // Corresponding free is in block_free | 489 // Corresponding free is in block_free |
490 targ_llong* pu = cast(targ_llong*) GC.malloc(targ_llong.sizeof * (numcases + 1)); | 490 targ_llong* pu = cast(targ_llong*) malloc(targ_llong.sizeof * (numcases + 1)); |
491 mystate.switchBlock.Bswitch = pu; | 491 mystate.switchBlock.Bswitch = pu; |
492 /* First pair is the number of cases, and the default block | 492 /* First pair is the number of cases, and the default block |
493 */ | 493 */ |
494 *pu++ = numcases; | 494 *pu++ = numcases; |
495 list_append(&mystate.switchBlock.Bsucc, mystate.defaultBlock); | 495 list_append(&mystate.switchBlock.Bsucc, mystate.defaultBlock); |