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

Changeset 609

Show
Ignore:
Timestamp:
08/09/10 21:39:13 (14 years ago)
Author:
walter
Message:

fix segfault with OPnegass

Files:

Legend:

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

    r588 r609  
    477477 
    478478        elem_debug(d); 
    479479 
    480480        //printf("\trd: "); WReqn(d); printf("\n"); 
    481481        if (d->Eoper == OPasm)          /* OPasm elems ruin everything  */ 
    482482            goto noprop; 
    483483#if 0 
    484484        // Runs afoul of Buzilla 4506 
    485485        if (OTassign(d->Eoper) && EBIN(d))      // if assignment elem 
    486486#else 
    487487        if (OTassign(d->Eoper))      // if assignment elem 
    488488#endif 
    489489        {   elem *t = Elvalue(d); 
    490490 
    491491            if (t->Eoper == OPvar) 
    492492            {   assert(t->EV.sp.Vsym == sv); 
    493493 
    494494                if (d->Eoper == OPstreq || 
    495495                    !tyscalar(t->Ety)) 
    496496                    goto noprop;        // not worth bothering with these cases 
     497 
     498                if (d->Eoper == OPnegass) 
     499                    goto noprop;        // don't bother with this case, either 
    497500 
    498501                /* Everything must match or we must skip this variable  */ 
    499502                /* (in case of assigning to overlapping unions, etc.)   */ 
    500503                if (t->EV.sp.Voffset != noff || 
    501504                    /* If sizes match, we are ok        */ 
    502505                    size(t->Ety) != nsize && 
    503506                        !(d->E2->Eoper == OPconst && size(t->Ety) > nsize && !tyfloating(d->E2->Ety))) 
    504507                    goto noprop; 
    505508            } 
    506509            else 
    507510            {   if (unambig)            /* unambiguous assignments only */ 
    508511                    continue; 
    509512                goto noprop; 
    510513            } 
    511514            if (d->Eoper != OPeq) 
    512515                goto noprop; 
    513516        } 
    514517        else                            /* must be a call elem          */ 
    515518        { 
    516519            if (unambig) 
  • branches/dmd-1.x/src/win32.mak

    r606 r609  
    9292    debug.obj code.obj cg87.obj cgsched.obj ee.obj csymbol.obj \ 
    9393    cgcod.obj cod1.obj cod2.obj cod3.obj cod4.obj cod5.obj outbuf.obj \ 
    9494    bcomplex.obj iasm.obj ptrntab.obj aa.obj ti_achar.obj md5.obj 
    9595 
    9696# from ROOT 
    9797 
    9898ROOTOBJS= lstring.obj array.obj gnuc.obj man.obj rmem.obj port.obj root.obj \ 
    9999    stringtable.obj dchar.obj response.obj async.obj speller.obj aav.obj 
    100100 
    101101OBJS= $(OBJ1) $(OBJ8) $(ROOTOBJS) 
    102102 
    103103SRCS= mars.c enum.c struct.c dsymbol.c import.c idgen.c impcnvgen.c utf.h \ 
    104104    utf.c entity.c identifier.c mtype.c expression.c optimize.c \ 
    105105    template.h template.c lexer.c declaration.c cast.c \ 
    106106    cond.h cond.c link.c aggregate.h staticassert.h parse.c statement.c \ 
    107107    constfold.c version.h version.c inifile.c iasm.c staticassert.c \ 
    108108    module.c scope.c dump.c init.h init.c attrib.h attrib.c opover.c \ 
    109109    eh.c toctype.c class.c mangle.c bit.c tocsym.c func.c inline.c \ 
    110110    access.c complex_t.h unialpha.c irstate.h irstate.c glue.c msc.c \ 
    111111    ph.c tk.c s2ir.c todt.c e2ir.c util.c toobj.c cppmangle.c \ 
    112     identifier.h parse.h objfile.h scope.h enum.h import.h \ 
     112    identifier.h parse.h scope.h enum.h import.h \ 
    113113    typinf.c tocvdebug.c toelfdebug.c mars.h module.h mtype.h dsymbol.h \ 
    114114    declaration.h lexer.h expression.h statement.h doc.h doc.c \ 
    115115    macro.h macro.c hdrgen.h hdrgen.c arraytypes.h \ 
    116116    delegatize.c toir.h toir.c interpret.c traits.c builtin.c \ 
    117117    clone.c lib.h libomf.c libelf.c libmach.c arrayop.c \ 
    118118    aliasthis.h aliasthis.c json.h json.c unittests.c imphint.c 
    119119 
    120120# From C++ compiler 
    121121 
    122122BACKSRC= $C\cdef.h $C\cc.h $C\oper.h $C\ty.h $C\optabgen.c \ 
    123123    $C\global.h $C\parser.h $C\code.h $C\type.h $C\dt.h $C\cgcv.h \ 
    124124    $C\el.h $C\iasm.h $C\rtlsym.h $C\html.h \ 
    125125    $C\bcomplex.c $C\blockopt.c $C\cg.c $C\cg87.c \ 
    126126    $C\cgcod.c $C\cgcs.c $C\cgcv.c $C\cgelem.c $C\cgen.c $C\cgobj.c \ 
    127127    $C\cgreg.c $C\var.c \ 
    128128    $C\cgsched.c $C\cod1.c $C\cod2.c $C\cod3.c $C\cod4.c $C\cod5.c \ 
    129129    $C\code.c $C\symbol.c $C\debug.c $C\dt.c $C\ee.c $C\el.c \ 
    130130    $C\evalu8.c $C\go.c $C\gflow.c $C\gdag.c \ 
    131131    $C\gother.c $C\glocal.c $C\gloop.c $C\html.c $C\newman.c \ 
    132132    $C\nteh.c $C\os.c $C\out.c $C\outbuf.c $C\ptrntab.c $C\rtlsym.c \ 
  • trunk/src/backend/gother.c

    r588 r609  
    477477 
    478478        elem_debug(d); 
    479479 
    480480        //printf("\trd: "); WReqn(d); printf("\n"); 
    481481        if (d->Eoper == OPasm)          /* OPasm elems ruin everything  */ 
    482482            goto noprop; 
    483483#if 0 
    484484        // Runs afoul of Buzilla 4506 
    485485        if (OTassign(d->Eoper) && EBIN(d))      // if assignment elem 
    486486#else 
    487487        if (OTassign(d->Eoper))      // if assignment elem 
    488488#endif 
    489489        {   elem *t = Elvalue(d); 
    490490 
    491491            if (t->Eoper == OPvar) 
    492492            {   assert(t->EV.sp.Vsym == sv); 
    493493 
    494494                if (d->Eoper == OPstreq || 
    495495                    !tyscalar(t->Ety)) 
    496496                    goto noprop;        // not worth bothering with these cases 
     497 
     498                if (d->Eoper == OPnegass) 
     499                    goto noprop;        // don't bother with this case, either 
    497500 
    498501                /* Everything must match or we must skip this variable  */ 
    499502                /* (in case of assigning to overlapping unions, etc.)   */ 
    500503                if (t->EV.sp.Voffset != noff || 
    501504                    /* If sizes match, we are ok        */ 
    502505                    size(t->Ety) != nsize && 
    503506                        !(d->E2->Eoper == OPconst && size(t->Ety) > nsize && !tyfloating(d->E2->Ety))) 
    504507                    goto noprop; 
    505508            } 
    506509            else 
    507510            {   if (unambig)            /* unambiguous assignments only */ 
    508511                    continue; 
    509512                goto noprop; 
    510513            } 
    511514            if (d->Eoper != OPeq) 
    512515                goto noprop; 
    513516        } 
    514517        else                            /* must be a call elem          */ 
    515518        { 
    516519            if (unambig)