mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-01-30 03:23:19 +01:00
[svn r369] Fix nested classes when nestedVar is not generated.
This commit is contained in:
@@ -837,9 +837,14 @@ DValue* DtoNewClass(TypeClass* tc, NewExp* newexp)
|
||||
{
|
||||
Logger::println("Resolving nested context");
|
||||
LOG_SCOPE;
|
||||
// this value might be zero if it was not necessary to generate it ...
|
||||
LLValue* nest = gIR->func()->nestedVar;
|
||||
// ... then revert to the this ptr if there is one
|
||||
if (!nest)
|
||||
nest = gIR->func()->thisVar;
|
||||
// ... or just use zero, since it must be unused.
|
||||
if (!nest)
|
||||
nest = llvm::ConstantPointerNull::get(getVoidPtrType());
|
||||
assert(nest);
|
||||
LLValue* gep = DtoGEPi(mem,0,2,"tmp");
|
||||
nest = DtoBitCast(nest, gep->getType()->getContainedType(0));
|
||||
|
||||
Reference in New Issue
Block a user