diff --git a/gen/llvmhelpers.cpp b/gen/llvmhelpers.cpp index 20503f81..69d94ec7 100644 --- a/gen/llvmhelpers.cpp +++ b/gen/llvmhelpers.cpp @@ -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"));