summaryrefslogtreecommitdiff
path: root/src/passes/Precompute.cpp
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2017-05-08 14:05:05 -0700
committerGitHub <noreply@github.com>2017-05-08 14:05:05 -0700
commitc72d10b7ffbc3083cf52de001407f89935422112 (patch)
tree543acd9eb2e3e4f16e51e5edd78f39251636d100 /src/passes/Precompute.cpp
parent0b8acfc0139652d1c0f284c7650812a309574586 (diff)
downloadbinaryen-c72d10b7ffbc3083cf52de001407f89935422112.tar.gz
binaryen-c72d10b7ffbc3083cf52de001407f89935422112.tar.bz2
binaryen-c72d10b7ffbc3083cf52de001407f89935422112.zip
fix an afl-fuzz bug where precompute alters a br to remove its condition, but does not properly modify the type (#1000)
Diffstat (limited to 'src/passes/Precompute.cpp')
-rw-r--r--src/passes/Precompute.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/passes/Precompute.cpp b/src/passes/Precompute.cpp
index dfb45f686..37686de1a 100644
--- a/src/passes/Precompute.cpp
+++ b/src/passes/Precompute.cpp
@@ -116,6 +116,7 @@ struct Precompute : public WalkerPass<PostWalker<Precompute, UnifiedExpressionVi
if (auto* br = curr->dynCast<Break>()) {
br->name = flow.breakTo;
br->condition = nullptr;
+ br->finalize(); // if we removed a condition, the type may change
if (flow.value.type != none) {
// reuse a const value if there is one
if (br->value) {