Mercurial > projects > ldc
comparison gen/statements.cpp @ 519:bc0835cd3440
Don't assert on empty foreach body.
Fixes:
run/f/foreach_28_B
author | Christian Kamm <kamm incasoftware de> |
---|---|
date | Sat, 16 Aug 2008 12:38:53 +0200 |
parents | 243485af6523 |
children | fbb1a366cfbc |
comparison
equal
deleted
inserted
replaced
518:243485af6523 | 519:bc0835cd3440 |
---|---|
911 if (global.params.symdebug) | 911 if (global.params.symdebug) |
912 DtoDwarfStopPoint(loc.linnum); | 912 DtoDwarfStopPoint(loc.linnum); |
913 | 913 |
914 //assert(arguments->dim == 1); | 914 //assert(arguments->dim == 1); |
915 assert(value != 0); | 915 assert(value != 0); |
916 assert(body != 0); | |
917 assert(aggr != 0); | 916 assert(aggr != 0); |
918 assert(func != 0); | 917 assert(func != 0); |
919 | 918 |
920 //Argument* arg = (Argument*)arguments->data[0]; | 919 //Argument* arg = (Argument*)arguments->data[0]; |
921 //Logger::println("Argument is %s", arg->toChars()); | 920 //Logger::println("Argument is %s", arg->toChars()); |
1009 value->ir.irLocal->value = valvar; | 1008 value->ir.irLocal->value = valvar; |
1010 } | 1009 } |
1011 | 1010 |
1012 // emit body | 1011 // emit body |
1013 p->loopbbs.push_back(IRLoopScope(this,enclosinghandler,nextbb,endbb)); | 1012 p->loopbbs.push_back(IRLoopScope(this,enclosinghandler,nextbb,endbb)); |
1014 body->toIR(p); | 1013 if(body) |
1014 body->toIR(p); | |
1015 p->loopbbs.pop_back(); | 1015 p->loopbbs.pop_back(); |
1016 | 1016 |
1017 if (!p->scopereturned()) | 1017 if (!p->scopereturned()) |
1018 llvm::BranchInst::Create(nextbb, p->scopebb()); | 1018 llvm::BranchInst::Create(nextbb, p->scopebb()); |
1019 | 1019 |