Do not assert if there's a struct-this nested context.

This commit is contained in:
Christian Kamm
2008-08-13 20:50:54 +02:00
parent 7ffb43fdc6
commit 8efde8d38d

View File

@@ -398,8 +398,7 @@ LLValue* DtoNestedContext(Loc loc, Dsymbol* sym)
else if (irfunc->thisArg)
{
ClassDeclaration* cd = irfunc->decl->isMember2()->isClassDeclaration();
assert(cd);
if (!cd->vthis)
if (!cd || !cd->vthis)
return getNullPtr(getVoidPtrType());
LLValue* val = DtoLoad(irfunc->thisArg);
return DtoLoad(DtoGEPi(val, 0,2+cd->vthis->ir.irField->index, ".vthis"));