summaryrefslogtreecommitdiffstats
path: root/source
diff options
context:
space:
mode:
authorTim Foley <tfoleyNV@users.noreply.github.com>2018-04-23 10:37:24 -0700
committerGitHub <noreply@github.com>2018-04-23 10:37:24 -0700
commit627de1ce502ce23dc0ef21a69c910a20547aa5c7 (patch)
tree1a3ebf5c7d59808f7490bda6df07f593aa194f2c /source
parent163d3068e332703cc499446fff37230a7c68e8f2 (diff)
Fix successor computation for `switch` instruction (#520)
Fixes #519 The code was leaving out the `default` label from the successor list, which would break any passes that require an accurate CFG (with the big one right now being the SSA-formation pass).
Diffstat (limited to 'source')
-rw-r--r--source/slang/ir.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/source/slang/ir.cpp b/source/slang/ir.cpp
index a75a02ca7..2b0e19a0c 100644
--- a/source/slang/ir.cpp
+++ b/source/slang/ir.cpp
@@ -312,7 +312,7 @@ namespace Slang
case kIROp_switch:
// switch <val> <break> <default> <caseVal1> <caseBlock1> ...
- begin = operands + 4;
+ begin = operands + 2;
// TODO: this ends up point one *after* the "one after the end"
// location, so we should really change the representation