From 1a5b410701542413f497b3030c0b87f3600dc1bc Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Thu, 7 Mar 2019 09:07:30 -0800 Subject: Fix getExitingBranches, which had |targets| instead of |curr->targets| (#1936) That caused it to miss switch targets, and a code-folding bug. Fixes #1838 Sadly the fuzzer didn't find this because code folding looks for very particular code patterns that are unlikely to be emitted randomly. --- src/ir/branch-utils.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/ir/branch-utils.h b/src/ir/branch-utils.h index e8fd25119..b9448e590 100644 --- a/src/ir/branch-utils.h +++ b/src/ir/branch-utils.h @@ -95,7 +95,7 @@ inline std::set getExitingBranches(Expression* ast) { targets.insert(curr->name); } void visitSwitch(Switch* curr) { - for (auto target : targets) { + for (auto target : curr->targets) { targets.insert(target); } targets.insert(curr->default_); -- cgit v1.2.3