Mercurial > projects > ldc
changeset 1636:332925de1881
Fix #398.
Tested by Deewiant.
author | Christian Kamm <kamm incasoftware de> |
---|---|
date | Mon, 08 Mar 2010 17:44:38 +0100 |
parents | 601d3eea4a68 |
children | a6a839bcc18a 0de4525a9ed6 |
files | gen/statements.cpp |
diffstat | 1 files changed, 6 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- 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())