[libcxx-commits] [PATCH] D143010: [libc++abi][AIX] Skip non-C++ EH aware frames when retrieving exception object

Xing Xue via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Jan 31 13:25:02 PST 2023


xingxue created this revision.
xingxue added reviewers: ldionne, MaskRay, cebowleratibm, hubert.reinterpretcast, daltenty.
xingxue added a project: LLVM.
Herald added a project: All.
xingxue requested review of this revision.
Herald added a project: libc++abi.
Herald added a subscriber: libcxx-commits.
Herald added a reviewer: libc++abi.

The personality routine for the legacy AIX xlclang++ compiler uses the stack slot reserved for compilers to pass the exception object to the landing pad. The landing pad retrieves the exception object with a call to the runtime function `__xlc_exception_handle()`. The current implementation incorrectly assumes `__xlc_exception_handle()` goes up one stack frame to get to the stack frame of the caller of `__xlc_exception_handle()` which is supposedly the stack frame of the function containing the landing pad. However, this does not always work, .e.g., the xlclang++ compiler sometimes generates a wrapper of `__xlc_exception_handle()` and calls the wrapper from the landing pad for optimization purposes. This patch changes the implementation to unwind the stack from `__xlc_exception_handle()` and skip non-C++ EH aware frames until a C++ EH aware frame is found and then retrieves the exception object from that frame.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D143010

Files:
  libcxxabi/src/aix_state_tab_eh.inc
  libcxxabi/test/vendor/ibm/aix_xlclang_passing_excp_obj_32.pass.sh.S
  libcxxabi/test/vendor/ibm/aix_xlclang_passing_excp_obj_64.pass.sh.S

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D143010.493706.patch
Type: text/x-patch
Size: 57591 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20230131/df58a5d4/attachment-0001.bin>


More information about the libcxx-commits mailing list