File tree Expand file tree Collapse file tree 2 files changed +40
-0
lines changed Expand file tree Collapse file tree 2 files changed +40
-0
lines changed Original file line number Diff line number Diff line change @@ -51,6 +51,11 @@ struct StripEHImpl : public WalkerPass<PostWalker<StripEHImpl>> {
5151 refinalize = true ;
5252 }
5353
54+ void visitTryTable (TryTable* curr) {
55+ replaceCurrent (curr->body );
56+ refinalize = true ;
57+ }
58+
5459 void visitFunction (Function* curr) {
5560 if (refinalize) {
5661 ReFinalize ().walkFunctionInModule (curr, getModule ());
Original file line number Diff line number Diff line change 1+ ;; NOTE: Assertions have been generated by update_lit_checks.py and should not be edited.
2+ ;; RUN: wasm-opt %s -all --strip-eh -S -o - | filecheck %s
3+
4+ ;; Remove all EH instructions and tags. Converts 'throw's into 'unreachable's.
5+
6+ (module
7+ (tag $e-i32 (param i32 ))
8+ (tag $e-f32 (param f32 ))
9+
10+ ;; CHECK: (func $throw-i32 (type $0)
11+ ;; CHECK-NEXT: (unreachable)
12+ ;; CHECK-NEXT: )
13+ (func $throw-i32
14+ (throw $e-i32 (i32.const 0 ))
15+ )
16+ ;; CHECK: (func $throw-f32 (type $0)
17+ ;; CHECK-NEXT: (unreachable)
18+ ;; CHECK-NEXT: )
19+ (func $throw-f32
20+ (throw $e-f32 (f32.const 0.0 ))
21+ )
22+
23+ ;; CHECK: (func $try-catch (type $0)
24+ ;; CHECK-NEXT: (block $out
25+ ;; CHECK-NEXT: (call $throw-f32)
26+ ;; CHECK-NEXT: )
27+ ;; CHECK-NEXT: )
28+ (func $try-catch
29+ (block $out
30+ (try_table (catch_all $out )
31+ (call $throw-f32 )
32+ )
33+ )
34+ )
35+ )
You can’t perform that action at this time.
0 commit comments