mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-01-28 18:43:13 +01:00
Merged DMD commit 645b5d8797768bced8db0c32dfa03e9290d0ced0:
5248 CTFE Segfault when calling a function on an enum struct Fix the D1 version of this bug, which causes a stack overflow rather than a segfault: compiler inserts assert(this, "null this") whereas for D2 it is assert(&this, "null this")
This commit is contained in:
@@ -3102,7 +3102,7 @@ Expression *AssertExp::interpret(InterState *istate)
|
||||
{ // Special case: deal with compiler-inserted assert(&this, "null this")
|
||||
AddrExp *ade = (AddrExp *)this->e1;
|
||||
if (ade->e1->op == TOKthis && istate->localThis)
|
||||
if (ade->e1->op == TOKdotvar
|
||||
if (istate->localThis->op == TOKdotvar
|
||||
&& ((DotVarExp *)(istate->localThis))->e1->op == TOKthis)
|
||||
return getVarExp(loc, istate, ((DotVarExp*)(istate->localThis))->var);
|
||||
else
|
||||
@@ -3111,7 +3111,13 @@ Expression *AssertExp::interpret(InterState *istate)
|
||||
if (this->e1->op == TOKthis)
|
||||
{
|
||||
if (istate->localThis)
|
||||
return istate->localThis->interpret(istate);
|
||||
{
|
||||
if (istate->localThis->op == TOKdotvar
|
||||
&& ((DotVarExp *)(istate->localThis))->e1->op == TOKthis)
|
||||
return getVarExp(loc, istate, ((DotVarExp*)(istate->localThis))->var);
|
||||
else
|
||||
return istate->localThis->interpret(istate);
|
||||
}
|
||||
}
|
||||
e1 = this->e1->interpret(istate);
|
||||
if (e1 == EXP_CANT_INTERPRET)
|
||||
|
||||
Reference in New Issue
Block a user