Note: This website is archived. For up-to-date information about D projects and development, please visit wiki.dlang.org.

Changeset 631

Show
Ignore:
Timestamp:
08/27/10 06:25:56 (14 years ago)
Author:
walter
Message:

Issue 4655 - Regression(1.063, 2.048) goto to a try block ICEs

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/dmd-1.x/src/s2ir.c

    r618 r631  
    8989 * Convert label to block. 
    9090 */ 
    9191 
    9292block *labelToBlock(Loc loc, Blockx *blx, LabelDsymbol *label, int flag = 0) 
    9393{ 
    9494    if (!label->statement) 
    9595    { 
    9696        error(loc, "undefined label %s", label->toChars()); 
    9797        return NULL; 
    9898    } 
    9999    LabelStatement *s = label->statement; 
    100100    if (!s->lblock) 
    101101    {   s->lblock = block_calloc(blx); 
    102102        s->lblock->Btry = NULL;         // fill this in later 
    103103 
    104104        if (flag) 
    105105        { 
    106106            // Keep track of the forward reference to this block, so we can check it later 
    107107            if (!s->fwdrefs) 
    108108                s->fwdrefs = new Array(); 
    109             s->fwdrefs->push(s->lblock); 
     109            s->fwdrefs->push(blx->curblock); 
    110110        } 
    111111    } 
    112112    return s->lblock; 
    113113} 
    114114 
    115115/************************************** 
    116116 * Add in code to increment usage count for linnum. 
    117117 */ 
    118118 
    119119void incUsage(IRState *irs, Loc loc) 
    120120{ 
    121121 
    122122    if (global.params.cov && loc.linnum) 
    123123    { 
    124124        block_appendexp(irs->blx->curblock, incUsageElem(irs, loc)); 
    125125    } 
    126126} 
    127127 
    128128/**************************************** 
    129129 * This should be overridden by each statement class. 
  • trunk/src/s2ir.c

    r618 r631  
    8787 * Convert label to block. 
    8888 */ 
    8989 
    9090block *labelToBlock(Loc loc, Blockx *blx, LabelDsymbol *label, int flag = 0) 
    9191{ 
    9292    if (!label->statement) 
    9393    { 
    9494        error(loc, "undefined label %s", label->toChars()); 
    9595        return NULL; 
    9696    } 
    9797    LabelStatement *s = label->statement; 
    9898    if (!s->lblock) 
    9999    {   s->lblock = block_calloc(blx); 
    100100        s->lblock->Btry = NULL;         // fill this in later 
    101101 
    102102        if (flag) 
    103103        { 
    104104            // Keep track of the forward reference to this block, so we can check it later 
    105105            if (!s->fwdrefs) 
    106106                s->fwdrefs = new Array(); 
    107             s->fwdrefs->push(s->lblock); 
     107            s->fwdrefs->push(blx->curblock); 
    108108        } 
    109109    } 
    110110    return s->lblock; 
    111111} 
    112112 
    113113/************************************** 
    114114 * Add in code to increment usage count for linnum. 
    115115 */ 
    116116 
    117117void incUsage(IRState *irs, Loc loc) 
    118118{ 
    119119 
    120120    if (global.params.cov && loc.linnum) 
    121121    { 
    122122        block_appendexp(irs->blx->curblock, incUsageElem(irs, loc)); 
    123123    } 
    124124} 
    125125 
    126126/**************************************** 
    127127 * This should be overridden by each statement class.