Mercurial > projects > ldc
comparison gen/classes.cpp @ 370:051ab876fe11 trunk
[svn r391] Fix classes nested inside functions for real.
author | ChristianK |
---|---|
date | Tue, 15 Jul 2008 10:23:50 +0200 |
parents | 7d91d82000ae |
children | ac1fcc138e42 |
comparison
equal
deleted
inserted
replaced
369:7d91d82000ae | 370:051ab876fe11 |
---|---|
826 else if (tc->sym->isNested()) | 826 else if (tc->sym->isNested()) |
827 { | 827 { |
828 Logger::println("Resolving nested context"); | 828 Logger::println("Resolving nested context"); |
829 LOG_SCOPE; | 829 LOG_SCOPE; |
830 | 830 |
831 LLValue* gep = DtoGEPi(mem,0,2,"tmp"); | 831 size_t idx = 2 + tc->sym->vthis->ir.irField->index; |
832 LLValue* gep = DtoGEPi(mem,0,idx,"tmp"); | |
832 | 833 |
833 // this value might be zero if it was not necessary to generate it ... | 834 // this value might be zero if it was not necessary to generate it ... |
834 LLValue* nest = gIR->func()->nestedVar; | 835 LLValue* nest = gIR->func()->nestedVar; |
835 // ... then revert to the this ptr if there is one | 836 // ... then revert to the this ptr if there is one |
836 if (!nest) | 837 if (!nest) |