Wiki Roadmap Timeline Tickets New Ticket Source Search Help / Guide About Trac Login

Ticket #239: bug239.patch

File bug239.patch, 1.6 kB (added by ChristianK, 3 years ago)

ugly patch

  • a/gen/dvalue.cpp

    old new  
    1616    var = vd; 
    1717    val = llvmValue; 
    1818    type = t; 
     19    forceStaticLookup = false; 
    1920} 
    2021 
    2122DVarValue::DVarValue(Type* t, LLValue* llvmValue) 
     
    2324    var = 0; 
    2425    val = llvmValue; 
    2526    type = t; 
     27    forceStaticLookup = false; 
    2628} 
    2729 
    2830LLValue* DVarValue::getLVal() 
  • a/gen/dvalue.h

    old new  
    107107 
    108108    virtual Type*& getType() { assert(type); return type; } 
    109109    virtual DVarValue* isVar() { return this; } 
     110     
     111    bool forceStaticLookup; 
    110112}; 
    111113 
    112114// field d-value 
  • a/gen/toir.cpp

    old new  
    11051105        if (!vthis2) vthis2 = vthis; 
    11061106 
    11071107        // super call 
    1108         if (e1->op == TOKsuper) { 
     1108        DVarValue* varl = l->isVar(); 
     1109        if (e1->op == TOKsuper || (varl && varl->forceStaticLookup)) { 
    11091110            DtoForceDeclareDsymbol(fdecl); 
    11101111            funcval = fdecl->ir.irFunc->func; 
    11111112            assert(funcval); 
     
    25682569{ 
    25692570    Type* t = sym->getType(); 
    25702571    assert(t); 
    2571     return e1->toElem(p); 
     2572    DValue* v = e1->toElem(p); 
     2573    DVarValue* vv = v->isVar(); 
     2574    assert(vv && "expect exp to be VarValue in <exp>.Type expression"); 
     2575    vv->forceStaticLookup = true; 
     2576    return vv; 
    25722577} 
    25732578 
    25742579////////////////////////////////////////////////////////////////////////////////////////// 
Copyright © 2008, LDC Development Team.