From 627de1ce502ce23dc0ef21a69c910a20547aa5c7 Mon Sep 17 00:00:00 2001 From: Tim Foley Date: Mon, 23 Apr 2018 10:37:24 -0700 Subject: 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). --- source/slang/ir.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source') 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 ... - 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 -- cgit v1.2.3