# HG changeset patch # User ChristianK # Date 1213999256 -7200 # Node ID 74348f16222530c9ff46e080a0e0d8a6a3e9f934 # Parent f5f97ca47b33d0d5334e4ba9cee67d69e8664181 [svn r303] Start a new basicblock behind a HaltExp to prevent compiler errors. diff -r f5f97ca47b33 -r 74348f162225 gen/toir.cpp --- a/gen/toir.cpp Fri Jun 20 23:38:51 2008 +0200 +++ b/gen/toir.cpp Sat Jun 21 00:00:56 2008 +0200 @@ -2238,6 +2238,14 @@ #endif new llvm::UnreachableInst(p->scopebb()); + + // this terminated the basicblock, start a new one + // this is sensible, since someone might goto behind the assert + // and prevents compiler errors if a terminator follows the assert + llvm::BasicBlock* oldend = gIR->scopeend(); + llvm::BasicBlock* bb = llvm::BasicBlock::Create("afterhalt", p->topfunc(), oldend); + p->scope() = IRScope(bb,oldend); + return 0; }