# HG changeset patch # User Christian Kamm # Date 1257588877 -3600 # Node ID 8aa756a002283d20f48cc50d8ee2b0537e082b58 # Parent 27948fd2e7ef4c13199a4fe6fa4acffeabed0736 Replace DMD's isSymbolDeclaration with isStaticStructInitDeclaration. See also [913] and bug #198. diff -r 27948fd2e7ef -r 8aa756a00228 dmd/interpret.c --- a/dmd/interpret.c Sat Nov 07 11:01:49 2009 +0100 +++ b/dmd/interpret.c Sat Nov 07 11:14:37 2009 +0100 @@ -196,15 +196,12 @@ } if (!v2->value || v2->value->op != TOKvar) break; -//TODO -#ifdef IN_DMD - if (((VarExp *)v2->value)->var->isSymbolDeclaration()) + if (((VarExp *)v2->value)->var->isStaticStructInitDeclaration()) { // This can happen if v is a struct initialized to // 0 using an __initZ SymbolDeclaration from // TypeStruct::defaultInit() break; // eg default-initialized variable } -#endif earg = v2->value; } @@ -1608,15 +1605,12 @@ if (v && v->value && v->value->op == TOKvar) { VarExp *ve2 = (VarExp *)v->value; -//TODO -#ifdef IN_DMD - if (ve2->var->isSymbolDeclaration()) + if (ve2->var->isStaticStructInitDeclaration()) { // This can happen if v is a struct initialized to // 0 using an __initZ SymbolDeclaration from // TypeStruct::defaultInit() } else -#endif e1 = v->value; } else if (v && v->value && (v->value->op==TOKindex || v->value->op == TOKdotvar)) @@ -1694,15 +1688,12 @@ if (v->value && v->value->op == TOKvar) { VarExp *ve2 = (VarExp *)v->value; -//TODO -#ifdef IN_DMD - if (ve2->var->isSymbolDeclaration()) + if (ve2->var->isStaticStructInitDeclaration()) { // This can happen if v is a struct initialized to // 0 using an __initZ SymbolDeclaration from // TypeStruct::defaultInit() } else -#endif v = ve2->var->isVarDeclaration(); assert(v); } @@ -1814,15 +1805,12 @@ if (v->value && v->value->op == TOKvar) { VarExp *ve2 = (VarExp *)v->value; -// TODO -#ifdef IN_DMD - if (ve2->var->isSymbolDeclaration()) + if (ve2->var->isStaticStructInitDeclaration()) { // This can happen if v is a struct initialized to // 0 using an __initZ SymbolDeclaration from // TypeStruct::defaultInit() } else -#endif v = ve2->var->isVarDeclaration(); assert(v); } @@ -2073,15 +2061,12 @@ if (v->value && v->value->op == TOKvar) { VarExp *ve2 = (VarExp *)v->value; -// TODO -#ifdef IN_DMD - if (ve2->var->isSymbolDeclaration()) + if (ve2->var->isStaticStructInitDeclaration()) { // This can happen if v is a struct initialized to // 0 using an __initZ SymbolDeclaration from // TypeStruct::defaultInit() } else -#endif v = ve2->var->isVarDeclaration(); assert(v); }