mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-01-11 18:33:14 +01:00
Fix break out of non-nothrow range foreach.
Fixes DMD testcase 'test9068'.
This commit is contained in:
@@ -54,12 +54,19 @@ IRTargetScope::IRTargetScope()
|
||||
{
|
||||
}
|
||||
|
||||
IRTargetScope::IRTargetScope(Statement* s, EnclosingHandler* enclosinghandler, llvm::BasicBlock* continueTarget, llvm::BasicBlock* breakTarget)
|
||||
IRTargetScope::IRTargetScope(
|
||||
Statement* s,
|
||||
EnclosingHandler* enclosinghandler,
|
||||
llvm::BasicBlock* continueTarget,
|
||||
llvm::BasicBlock* breakTarget,
|
||||
bool onlyLabeledBreak
|
||||
)
|
||||
{
|
||||
this->s = s;
|
||||
this->enclosinghandler = enclosinghandler;
|
||||
this->breakTarget = breakTarget;
|
||||
this->continueTarget = continueTarget;
|
||||
this->onlyLabeledBreak = onlyLabeledBreak;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -554,7 +554,7 @@ void BreakStatement::toIR(IRState* p)
|
||||
FuncGen::TargetScopeVec::reverse_iterator it = p->func()->gen->targetScopes.rbegin();
|
||||
FuncGen::TargetScopeVec::reverse_iterator it_end = p->func()->gen->targetScopes.rend();
|
||||
while(it != it_end) {
|
||||
if(it->breakTarget) {
|
||||
if(it->breakTarget && !it->onlyLabeledBreak) {
|
||||
break;
|
||||
}
|
||||
++it;
|
||||
@@ -683,7 +683,15 @@ void TryFinallyStatement::toIR(IRState* p)
|
||||
IRLandingPad& pad = gIR->func()->gen->landingPadInfo;
|
||||
pad.addFinally(finalbody);
|
||||
pad.push(landingpadbb);
|
||||
gIR->func()->gen->targetScopes.push_back(IRTargetScope(this,new EnclosingTryFinally(this,gIR->func()->gen->landingPad),NULL,NULL));
|
||||
gIR->func()->gen->targetScopes.push_back(
|
||||
IRTargetScope(
|
||||
this,
|
||||
new EnclosingTryFinally(this, gIR->func()->gen->landingPad),
|
||||
NULL,
|
||||
endbb,
|
||||
true
|
||||
)
|
||||
);
|
||||
|
||||
//
|
||||
// do the try block
|
||||
|
||||
Reference in New Issue
Block a user