summaryrefslogtreecommitdiff
path: root/src/ir/iteration.h
diff options
context:
space:
mode:
authorHeejin Ahn <aheejin@gmail.com>2021-11-08 22:44:29 -0800
committerGitHub <noreply@github.com>2021-11-08 22:44:29 -0800
commit1ad4e23342ef83b9210ce81bbf119047e08b6f3b (patch)
tree652dd07126bb7251cb7d3811fefb968ae684f173 /src/ir/iteration.h
parent31a5bf7ad7dbe30ec47766271ba13276117f98a0 (diff)
downloadbinaryen-1ad4e23342ef83b9210ce81bbf119047e08b6f3b.tar.gz
binaryen-1ad4e23342ef83b9210ce81bbf119047e08b6f3b.tar.bz2
binaryen-1ad4e23342ef83b9210ce81bbf119047e08b6f3b.zip
[EH] Improve catch validation (#4315)
This improves validation of `catch` bodies mostly by checking the validity of `pop`s. For every `catch` body: - Checks if its tag exists - If the tag's type is none: - Ensures there shouldn't be any `pop`s - If the tag's type is not none: - Checks if there's a single `pop` within the catch body - Checks if the tag type matches the `pop`'s type - Checks if the `pop`'s location is valid For every `catch_all` body: - Ensures there shuldn't be any `pop`s This uncovers several bugs related to `pop`s in existing tests, which this PR also fixes.
Diffstat (limited to 'src/ir/iteration.h')
-rw-r--r--src/ir/iteration.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/ir/iteration.h b/src/ir/iteration.h
index b3553f1ec..29d183678 100644
--- a/src/ir/iteration.h
+++ b/src/ir/iteration.h
@@ -53,6 +53,8 @@ template<class Specific> class AbstractChildIterator {
return index != other.index || &parent != &(other.parent);
}
+ bool operator==(const Iterator& other) const { return !(*this != other); }
+
void operator++() { index++; }
Expression*& operator*() {