summaryrefslogtreecommitdiff
path: root/src/ir/effects.h
diff options
context:
space:
mode:
authorThomas Lively <7121787+tlively@users.noreply.github.com>2022-08-29 12:48:46 -0700
committerGitHub <noreply@github.com>2022-08-29 12:48:46 -0700
commitbd630d707253a9838a3d0306e4be680942ff0715 (patch)
treeb51a786d3afd3ee97a78eb0d3923fb6ad59565d5 /src/ir/effects.h
parent8108ce28e66f1002932f6e5dc9dd4f23c8b8a9f3 (diff)
downloadbinaryen-bd630d707253a9838a3d0306e4be680942ff0715.tar.gz
binaryen-bd630d707253a9838a3d0306e4be680942ff0715.tar.bz2
binaryen-bd630d707253a9838a3d0306e4be680942ff0715.zip
Implement `extern.externalize` and `extern.internalize` (#4975)
These new GC instructions infallibly convert between `extern` and `any` references now that those types are not in the same hierarchy.
Diffstat (limited to 'src/ir/effects.h')
-rw-r--r--src/ir/effects.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/ir/effects.h b/src/ir/effects.h
index 5e50441ac..f5fdc5184 100644
--- a/src/ir/effects.h
+++ b/src/ir/effects.h
@@ -726,6 +726,10 @@ private:
parent.implicitTrap = true;
}
void visitRefAs(RefAs* curr) {
+ if (curr->op == ExternInternalize || curr->op == ExternExternalize) {
+ // These conversions are infallible.
+ return;
+ }
// traps when the arg is not valid
parent.implicitTrap = true;
// Note: We could be more precise here and report the lack of a possible