# HG changeset patch # User Christian Kamm # Date 1268066678 -3600 # Node ID 332925de1881f594a19abac2df2b4ca61974d129 # Parent 601d3eea4a680c43f50394c086581d1c411191d5 Fix #398. Tested by Deewiant. diff -r 601d3eea4a68 -r 332925de1881 gen/statements.cpp --- a/gen/statements.cpp Fri Mar 05 21:40:51 2010 +0200 +++ b/gen/statements.cpp Mon Mar 08 17:44:38 2010 +0100 @@ -295,7 +295,8 @@ // while body code p->func()->gen->targetScopes.push_back(IRTargetScope(this,NULL,whilebb,endbb)); - body->toIR(p); + if (body) + body->toIR(p); p->func()->gen->targetScopes.pop_back(); // loop @@ -331,7 +332,8 @@ // do-while body code p->func()->gen->targetScopes.push_back(IRTargetScope(this,NULL,condbb,endbb)); - body->toIR(p); + if (body) + body->toIR(p); p->func()->gen->targetScopes.pop_back(); // branch to condition block @@ -401,7 +403,8 @@ gIR->scope() = IRScope(forbodybb,forincbb); // do for body code - body->toIR(p); + if (body) + body->toIR(p); // move into the for increment block if (!gIR->scopereturned())