]> git.lizzy.rs Git - rust.git/commit - src/bootstrap/native.rs
Rollup merge of #106446 - bzEq:fix-unwind-lsda, r=Amanieu
authorYuki Okushi <huyuumi.dev+love@gmail.com>
Thu, 12 Jan 2023 20:47:21 +0000 (05:47 +0900)
committerGitHub <noreply@github.com>
Thu, 12 Jan 2023 20:47:21 +0000 (05:47 +0900)
commit3f21b812bec836dc3bc0f56d4e34b7c46ec68af1
tree07315c53a463f7a78a79a40201491ce661af456d
parentfa8f77a1deb0952fa81fd4f2f0809ceec8d7f7e8
parent93ef4b3991d19cddf011da8f0b5a7bf9a8672541
Rollup merge of #106446 - bzEq:fix-unwind-lsda, r=Amanieu

[LSDA] Take ttype_index into account when taking unwind action

If `cs_action != 0`, we should check the `ttype_index` field in action record. If `ttype_index == 0`, a clean up action is taken; otherwise catch action is taken.

This can fix unwind failure on AIX which uses LLVM's libunwind by default. IIUC, rust's LSDA is borrowed from c++ and I'm assuming itanium-cxx-abi https://itanium-cxx-abi.github.io/cxx-abi/exceptions.pdf should be followed, so the fix follows what libcxxabi does. See https://github.com/llvm/llvm-project/blob/ec48682ce9f61d056361c5095f21e930b8365661/libcxxabi/src/cxa_personality.cpp#L152 for use of `ttype_index`.