summaryrefslogtreecommitdiff
path: root/src/resolve-names.cc
diff options
context:
space:
mode:
authorSoni L. <EnderMoneyMod@gmail.com>2024-11-20 14:51:48 -0300
committerGitHub <noreply@github.com>2024-11-20 09:51:48 -0800
commita0b7abef00b59eeafed58c774195189425d020b0 (patch)
tree6f7b0747d3a3ef435bda9ac14ca22d417877796b /src/resolve-names.cc
parent958d0a72030227bf3133c8b99c7c670bcdbc7636 (diff)
downloadwabt-a0b7abef00b59eeafed58c774195189425d020b0.tar.gz
wabt-a0b7abef00b59eeafed58c774195189425d020b0.tar.bz2
wabt-a0b7abef00b59eeafed58c774195189425d020b0.zip
binary/wat: Implement EHv4 (#2470)
This pull request implements EHv4. Binary is mostly untested until interp is working.
Diffstat (limited to 'src/resolve-names.cc')
-rw-r--r--src/resolve-names.cc19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/resolve-names.cc b/src/resolve-names.cc
index 9fc8e443..67fc44e9 100644
--- a/src/resolve-names.cc
+++ b/src/resolve-names.cc
@@ -75,6 +75,8 @@ class NameResolver : public ExprVisitor::DelegateNop {
Result OnStoreExpr(StoreExpr*) override;
Result BeginTryExpr(TryExpr*) override;
Result EndTryExpr(TryExpr*) override;
+ Result BeginTryTableExpr(TryTableExpr*) override;
+ Result EndTryTableExpr(TryTableExpr*) override;
Result OnThrowExpr(ThrowExpr*) override;
Result OnRethrowExpr(RethrowExpr*) override;
Result OnSimdLoadLaneExpr(SimdLoadLaneExpr*) override;
@@ -442,6 +444,23 @@ Result NameResolver::EndTryExpr(TryExpr*) {
return Result::Ok;
}
+Result NameResolver::BeginTryTableExpr(TryTableExpr* expr) {
+ for (TableCatch& catch_ : expr->catches) {
+ if (!catch_.IsCatchAll()) {
+ ResolveTagVar(&catch_.tag);
+ }
+ ResolveLabelVar(&catch_.target);
+ }
+ PushLabel(expr->block.label);
+ ResolveBlockDeclarationVar(&expr->block.decl);
+ return Result::Ok;
+}
+
+Result NameResolver::EndTryTableExpr(TryTableExpr*) {
+ PopLabel();
+ return Result::Ok;
+}
+
Result NameResolver::OnCatchExpr(TryExpr*, Catch* catch_) {
if (!catch_->IsCatchAll()) {
ResolveTagVar(&catch_->var);