summaryrefslogtreecommitdiff
path: root/src/passes/RemoveUnusedNames.cpp
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2017-08-07 15:42:17 -0700
committerGitHub <noreply@github.com>2017-08-07 15:42:17 -0700
commitb93ea39b239052314123d3641df29ff5c5730515 (patch)
tree0149686671e54158ced8647287f28172782718bf /src/passes/RemoveUnusedNames.cpp
parent62f6a12c4fa109522229526e9d89969d2fde7399 (diff)
parente17202e4d20bf79bd285425bac606a31bf3a8131 (diff)
downloadbinaryen-b93ea39b239052314123d3641df29ff5c5730515.tar.gz
binaryen-b93ea39b239052314123d3641df29ff5c5730515.tar.bz2
binaryen-b93ea39b239052314123d3641df29ff5c5730515.zip
Merge pull request #1123 from WebAssembly/fuzz-2
Yet more fuzz fixes
Diffstat (limited to 'src/passes/RemoveUnusedNames.cpp')
-rw-r--r--src/passes/RemoveUnusedNames.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/passes/RemoveUnusedNames.cpp b/src/passes/RemoveUnusedNames.cpp
index 39bf068df..e5aaf5509 100644
--- a/src/passes/RemoveUnusedNames.cpp
+++ b/src/passes/RemoveUnusedNames.cpp
@@ -57,7 +57,7 @@ struct RemoveUnusedNames : public WalkerPass<PostWalker<RemoveUnusedNames>> {
void visitBlock(Block *curr) {
if (curr->name.is() && curr->list.size() == 1) {
auto* child = curr->list[0]->dynCast<Block>();
- if (child && child->name.is()) {
+ if (child && child->name.is() && child->type == curr->type) {
// we have just one child, this block, so breaking out of it goes to the same place as breaking out of us, we just need one name (and block)
auto& branches = branchesSeen[curr->name];
for (auto* branch : branches) {