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

Changeset 637

Show
Ignore:
Timestamp:
08/28/10 05:10:34 (14 years ago)
Author:
walter
Message:

Issue 3493 - Segfault(cast.c) Forward reference with type inference, D1 only.

Files:

Legend:

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

    r634 r637  
    39453945            type = type->semantic(loc, sc); 
    39463946        } 
    39473947#endif 
    39483948    } 
    39493949 
    39503950    if (type && !type->deco) 
    39513951        type = type->semantic(loc, sc); 
    39523952 
    39533953    /* Fix for 1161 doesn't work because it causes protection 
    39543954     * problems when instantiating imported templates passing private 
    39553955     * variables as alias template parameters. 
    39563956     */ 
    39573957    //accessCheck(loc, sc, NULL, var); 
    39583958 
    39593959    VarDeclaration *v = var->isVarDeclaration(); 
    39603960    if (v) 
    39613961    { 
    39623962        if (v->isConst() && v->type && type->toBasetype()->ty != Tsarray && v->init) 
    39633963        { 
    39643964            ExpInitializer *ei = v->init->isExpInitializer(); 
    3965             if (ei
     3965            if (ei && ei->exp->type
    39663966            { 
    39673967                //ei->exp->implicitCastTo(sc, type)->print(); 
    39683968                return ei->exp->implicitCastTo(sc, type); 
    39693969            } 
    39703970        } 
    39713971        v->checkNestedReference(sc, loc); 
    39723972#if DMDV2 
    39733973        if (sc->func && sc->func->isPure() && !sc->intypeof) 
    39743974        { 
    39753975            if (v->isDataseg() && !v->isImmutable()) 
    39763976                error("pure function '%s' cannot access mutable static data '%s'", sc->func->toChars(), v->toChars()); 
    39773977        } 
    39783978#endif 
    39793979    } 
    39803980#if 0 
    39813981    else if ((fd = var->isFuncLiteralDeclaration()) != NULL) 
    39823982    {   Expression *e; 
    39833983        e = new FuncExp(loc, fd); 
    39843984        e->type = type; 
    39853985        return e;