[all-commits] [llvm/llvm-project] b413b8: [libc++abi][AIX] Skip non-C++ EH aware frames when...
xingxue-ibm via All-commits
all-commits at lists.llvm.org
Wed Feb 15 08:15:37 PST 2023
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: b413b84a704e376860048e339e669adc6596a3ee
https://github.com/llvm/llvm-project/commit/b413b84a704e376860048e339e669adc6596a3ee
Author: Xing Xue <xingxue at outlook.com>
Date: 2023-02-15 (Wed, 15 Feb 2023)
Changed paths:
M libcxxabi/src/aix_state_tab_eh.inc
A libcxxabi/test/vendor/ibm/aix_xlclang_passing_excp_obj_32.pass.sh.S
A libcxxabi/test/vendor/ibm/aix_xlclang_passing_excp_obj_64.pass.sh.S
Log Message:
-----------
[libc++abi][AIX] Skip non-C++ EH aware frames when retrieving exception object
Summary:
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 that __xlc_exception_handle() should go 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 frames not associated with functions that are C++ EH-aware until a frame associated with a C++ EH-aware function is found and then retrieving the exception object with the expectation that the located frame is the one that the personality routine installed as it transferred control to the landing pad.
Reviewed by: cebowleratibm, hubert.reinterpretcast, daltenty
Differential Revision: https://reviews.llvm.org/D143010
More information about the All-commits
mailing list