[PATCH] D96595: [WebAssemblly] Fix rethrow's argument computation

Derek Schuff via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 12 09:53:10 PST 2021


dschuff accepted this revision.
dschuff added a comment.
This revision is now accepted and ready to land.

In D96595#2559644 <https://reviews.llvm.org/D96595#2559644>, @aheejin wrote:

> This replaces D96532 <https://reviews.llvm.org/D96532>. D96532 <https://reviews.llvm.org/D96532> didn't correctly handle this case:
>
>   try
>     ...
>   catch
>     try
>       rethrow 1 ;; (1)
>     catch
>       rethrow 0 ;; (2)
>     end
>   end

OK, I think I get the indexing scheme now... I didn't think about 'try' having a label, so if (1) were 'rethrow 0' it would refer to the 'try' (and therefore be invalid)



================
Comment at: llvm/lib/Target/WebAssembly/WebAssemblyCFGStackify.cpp:1575
+  //
+  // When we are at 'rethrow' (d), while reversly traersign Stack the first
+  // 'end' we encounter is the 'end' (e), which corresponds to the 'catch' (c).
----------------



================
Comment at: llvm/test/CodeGen/WebAssembly/exception.mir:108
+    %0:i32 = CATCH &__cpp_exception, implicit-def dead $arguments
+    RETHROW 0, implicit-def dead $arguments
+
----------------
this is "RETHROW 0" in the test input because it's just the placeholder from ISel, right?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D96595/new/

https://reviews.llvm.org/D96595



More information about the llvm-commits mailing list