Fix with(symbol) statement.

This commit is contained in:
Christian Kamm
2008-12-07 16:02:43 +01:00
parent fe71199772
commit b83afa9eca

View File

@@ -1300,9 +1300,13 @@ void WithStatement::toIR(IRState* p)
assert(exp);
assert(body);
DValue* e = exp->toElem(p);
LLValue* mem = DtoRawVarDeclaration(wthis);
DtoStore(e->getRVal(), mem);
// with(..) can either be used with expressions or with symbols
// wthis == null indicates the symbol form
if (wthis) {
DValue* e = exp->toElem(p);
LLValue* mem = DtoRawVarDeclaration(wthis);
DtoStore(e->getRVal(), mem);
}
body->toIR(p);
}