Skip to content

Commit

Permalink
Enable exnref instrumentation when EH is enabled (#2379)
Browse files Browse the repository at this point in the history
`exnref` is enabled by not reference type feature but exception handling
feature. Sorry that I missed this in #2377.
  • Loading branch information
aheejin authored Oct 11, 2019
1 parent 4507ee5 commit c6cd444
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/passes/InstrumentLocals.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,10 @@ struct InstrumentLocals : public WalkerPass<PostWalker<InstrumentLocals>> {

if (curr->features.hasReferenceTypes()) {
addImport(curr, get_anyref, "aiia");
addImport(curr, get_exnref, "eiie");
addImport(curr, set_anyref, "aiia");
}
if (curr->features.hasExceptionHandling()) {
addImport(curr, get_exnref, "eiie");
addImport(curr, set_exnref, "eiie");
}
}
Expand Down
2 changes: 1 addition & 1 deletion test/passes/instrument-locals_all-features.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
(import "env" "set_f32" (func $set_f32 (param i32 i32 f32) (result f32)))
(import "env" "set_f64" (func $set_f64 (param i32 i32 f64) (result f64)))
(import "env" "get_anyref" (func $get_anyref (param i32 i32 anyref) (result anyref)))
(import "env" "get_exnref" (func $get_exnref (param i32 i32 exnref) (result exnref)))
(import "env" "set_anyref" (func $set_anyref (param i32 i32 anyref) (result anyref)))
(import "env" "get_exnref" (func $get_exnref (param i32 i32 exnref) (result exnref)))
(import "env" "set_exnref" (func $set_exnref (param i32 i32 exnref) (result exnref)))
(func $A (; 12 ;) (type $FUNCSIG$v)
(local $x i32)
Expand Down

0 comments on commit c6cd444

Please sign in to comment.