diff options
| author | Heejin Ahn <aheejin@gmail.com> | 2019-08-11 06:24:07 +0000 |
|---|---|---|
| committer | Heejin Ahn <aheejin@gmail.com> | 2019-08-11 06:24:07 +0000 |
| commit | 831efe0e0f0ce56b63fb6a07e2cc4844e7c47a34 (patch) | |
| tree | e241c11858a0ebaf5337dda6f8a6038b0c038906 /llvm/test/CodeGen/WebAssembly/function-info.mir | |
| parent | 7e71aa24bc0788690fea7f0d7eab400c6a784deb (diff) | |
| download | bcm5719-llvm-831efe0e0f0ce56b63fb6a07e2cc4844e7c47a34.tar.gz bcm5719-llvm-831efe0e0f0ce56b63fb6a07e2cc4844e7c47a34.zip | |
Fix __clang_call_termiante's argument for foreign exceptions
Summary:
When exceptions are repeatedly thrown in the middle of handling another
exception, we call `__clang_call_terminate` with the exception pointer
(i32) as an argument. But in case of foreign exceptions, we don't have
the pointer, so we call the function with 0. (This requires
`__clang_call_terminate` can deal with 0 argument, which will be done
later)
But previously the 0 argument was not added as a `i32.const 0` but an
immediate by mistake, causing the `call` instruction to take not an i32
but rather an exnref, because an `exnref` is left on top of the value
stack if `br_on_exn` is not taken.
```
block i32
br_on_exn 0, __cpp_exception
;; exnref is on top of stack now
i32.const 0 ;; This was missing!
call __clang_call_terminate
unreachable
end
call __clang_call_terminate ;; This takes i32 extracted by br_on_exn
```
Reviewers: dschuff
Subscribers: sbc100, jgravelle-google, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D65475
llvm-svn: 368527
Diffstat (limited to 'llvm/test/CodeGen/WebAssembly/function-info.mir')
0 files changed, 0 insertions, 0 deletions

