summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
Diffstat (limited to 'source')
-rw-r--r--source/slang/slang-lower-to-ir.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/source/slang/slang-lower-to-ir.cpp b/source/slang/slang-lower-to-ir.cpp
index d8dbaa812..e677c24dd 100644
--- a/source/slang/slang-lower-to-ir.cpp
+++ b/source/slang/slang-lower-to-ir.cpp
@@ -6622,8 +6622,13 @@ struct StmtLoweringVisitor : StmtVisitor<StmtLoweringVisitor>
}
context->shared->breakLabels.remove(stmt);
builder->setInsertInto(initialBlock);
+
+ auto parentFunc = initialBlock->getParent();
+ parentFunc->addBlock(breakLabel);
+
builder->emitIntrinsicInst(nullptr, kIROp_TargetSwitch, (UInt)args.getCount(), args.getBuffer());
- insertBlock(breakLabel);
+
+ builder->setInsertInto(breakLabel);
}
void visitTargetCaseStmt(TargetCaseStmt*)