Skip to content

Commit

Permalink
fix build error => goto crossing initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinNowak committed Aug 26, 2011
1 parent 4eddacc commit fbae2ea
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/statement.c
Expand Up @@ -1805,7 +1805,7 @@ Statement *ForeachStatement::semantic(Scope *sc)
*/
e = new VarExp(loc, r);
Expression *einit = new DotIdExp(loc, e, idhead);
Statement *makeargs;
Statement *makeargs, *forbody;
if (dim == 1)
{
Parameter *arg = arguments->tdata()[0];
Expand Down Expand Up @@ -1867,15 +1867,15 @@ Statement *ForeachStatement::semantic(Scope *sc)

}

Statement *body = new CompoundStatement(loc,
forbody = new CompoundStatement(loc,
makeargs, this->body);

s = new ForStatement(loc, init, condition, increment, body);
s = new ForStatement(loc, init, condition, increment, forbody);
#if 0
printf("init: %s\n", init->toChars());
printf("condition: %s\n", condition->toChars());
printf("increment: %s\n", increment->toChars());
printf("body: %s\n", body->toChars());
printf("body: %s\n", forbody->toChars());
#endif
s = s->semantic(sc);
break;
Expand Down

0 comments on commit fbae2ea

Please sign in to comment.