comparison gen/llvmhelpers.cpp @ 505:841589c97f20

Do not assert if there's a struct-this nested context.
author Christian Kamm <kamm incasoftware de>
date Wed, 13 Aug 2008 20:50:54 +0200
parents 7148a3f2b44b
children cecfee2d01a8
comparison
equal deleted inserted replaced
504:577211114d6d 505:841589c97f20
396 else if (irfunc->nestArg) 396 else if (irfunc->nestArg)
397 return irfunc->nestArg; 397 return irfunc->nestArg;
398 else if (irfunc->thisArg) 398 else if (irfunc->thisArg)
399 { 399 {
400 ClassDeclaration* cd = irfunc->decl->isMember2()->isClassDeclaration(); 400 ClassDeclaration* cd = irfunc->decl->isMember2()->isClassDeclaration();
401 assert(cd); 401 if (!cd || !cd->vthis)
402 if (!cd->vthis)
403 return getNullPtr(getVoidPtrType()); 402 return getNullPtr(getVoidPtrType());
404 LLValue* val = DtoLoad(irfunc->thisArg); 403 LLValue* val = DtoLoad(irfunc->thisArg);
405 return DtoLoad(DtoGEPi(val, 0,2+cd->vthis->ir.irField->index, ".vthis")); 404 return DtoLoad(DtoGEPi(val, 0,2+cd->vthis->ir.irField->index, ".vthis"));
406 } 405 }
407 else 406 else