Skip to content

Commit c6cd444

Browse files
authored
Enable exnref instrumentation when EH is enabled (#2379)
`exnref` is enabled by not reference type feature but exception handling feature. Sorry that I missed this in #2377.
1 parent 4507ee5 commit c6cd444

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/passes/InstrumentLocals.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,10 @@ struct InstrumentLocals : public WalkerPass<PostWalker<InstrumentLocals>> {
159159

160160
if (curr->features.hasReferenceTypes()) {
161161
addImport(curr, get_anyref, "aiia");
162-
addImport(curr, get_exnref, "eiie");
163162
addImport(curr, set_anyref, "aiia");
163+
}
164+
if (curr->features.hasExceptionHandling()) {
165+
addImport(curr, get_exnref, "eiie");
164166
addImport(curr, set_exnref, "eiie");
165167
}
166168
}

test/passes/instrument-locals_all-features.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
(import "env" "set_f32" (func $set_f32 (param i32 i32 f32) (result f32)))
1616
(import "env" "set_f64" (func $set_f64 (param i32 i32 f64) (result f64)))
1717
(import "env" "get_anyref" (func $get_anyref (param i32 i32 anyref) (result anyref)))
18-
(import "env" "get_exnref" (func $get_exnref (param i32 i32 exnref) (result exnref)))
1918
(import "env" "set_anyref" (func $set_anyref (param i32 i32 anyref) (result anyref)))
19+
(import "env" "get_exnref" (func $get_exnref (param i32 i32 exnref) (result exnref)))
2020
(import "env" "set_exnref" (func $set_exnref (param i32 i32 exnref) (result exnref)))
2121
(func $A (; 12 ;) (type $FUNCSIG$v)
2222
(local $x i32)

0 commit comments

Comments
 (0)