Mercurial > projects > ldc
changeset 348:3c5e19bfcbf2 trunk
[svn r369] Fix nested classes when nestedVar is not generated.
author | ChristianK |
---|---|
date | Sun, 13 Jul 2008 21:16:40 +0200 |
parents | 6057fdf797d8 |
children | d22d8d63c1fd |
files | gen/classes.cpp |
diffstat | 1 files changed, 5 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/gen/classes.cpp Sun Jul 13 20:49:10 2008 +0200 +++ b/gen/classes.cpp Sun Jul 13 21:16:40 2008 +0200 @@ -837,9 +837,14 @@ { 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));