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

Changeset 775

Show
Ignore:
Timestamp:
12/05/10 03:34:19 (14 years ago)
Author:
walter
Message:

bugzilla 5191 Combination of pure and nothrow result in a function that does nothing

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/e2ir.c

    r768 r775  
    274274                elem *et = e->E1; 
    275275                e->E1 = el_una(OPs32_d, TYdouble, e->E2); 
    276276                e->E1 = el_una(OPd_ld, TYldouble, e->E1); 
    277277                e->E2 = et; 
    278278            } 
    279279            else if (op == OPyl2x || op == OPyl2xp1) 
    280280            { 
    281281                elem *et = e->E1; 
    282282                e->E1 = e->E2; 
    283283                e->E2 = et; 
    284284            } 
    285285        } 
    286286        else 
    287287            e = el_una(op,tyret,ep); 
    288288    } 
    289289    else if (ep) 
    290290    {   /* Do not do "no side effect" calls if a hidden parameter is passed, 
    291291         * as the return value is stored through the hidden parameter, which 
    292292         * is a side effect. 
    293293         */ 
    294         e = el_bin((tf->purity == PUREstrong && tf->isnothrow && (retmethod != RETstack)) ? 
    295                 OPcallns : OPcall,tyret,ec,ep); 
     294        e = el_bin(((fd ? fd->isPure() : tf->purity) == PUREstrong && 
     295                   tf->isnothrow && (retmethod != RETstack)) ? 
     296                   OPcallns : OPcall,tyret,ec,ep); 
    296297        if (tf->varargs) 
    297298            e->Eflags |= EFLAGS_variadic; 
    298299    } 
    299300    else 
    300     {   e = el_una((tf->purity == PUREstrong && tf->isnothrow && (retmethod != RETstack)) ? 
     301    {   e = el_una(((fd ? fd->isPure() : tf->purity) == PUREstrong && 
     302                tf->isnothrow && (retmethod != RETstack)) ? 
    301303                OPucallns : OPucall,tyret,ec); 
    302304        if (tf->varargs) 
    303305            e->Eflags |= EFLAGS_variadic; 
    304306    } 
    305307 
    306308    if (retmethod == RETstack) 
    307309    { 
    308310        e->Ety = TYnptr; 
    309311        e = el_una(OPind, tyret, e); 
    310312    } 
    311313 
    312314#if DMDV2 
    313315    if (tf->isref) 
    314316    { 
    315317        e->Ety = TYnptr; 
    316318        e = el_una(OPind, tyret, e); 
    317319    } 
    318320#endif 
    319321 
    320322    if (tybasic(tyret) == TYstruct)