summaryrefslogtreecommitdiff
path: root/libcxxabi/src
diff options
context:
space:
mode:
authorXing Xue <xingxue@outlook.com>2022-10-27 17:06:18 -0400
committerXing Xue <xingxue@outlook.com>2022-10-27 17:06:18 -0400
commitfb391e45e9cc35429f077413ca660f4f5f5212c1 (patch)
tree1063fe2770e1e5c85bcb91e2df767e319892e203 /libcxxabi/src
parent32c512e49ffe5b6ef1d4aa9bf87665c8e85e23c3 (diff)
downloadllvm-fb391e45e9cc35429f077413ca660f4f5f5212c1.tar.gz
[libc++abi][AIX] Use reserved slot in stack to pass the address of exception object
Summary: The existing implementation of the personality for legacy IBM xlclang++ compiler generated code passes the address of exception object in r14 for the landing pad to retrieve with a call to __xlc_exception_handle(). This clobbers the content of r14 in user code (and potentially, when running cleanup actions, the address of another exception object being passed). This patch changes to use the stack slot reserved for compilers to pass the address. It has been confirmed that xlclang++-generated code does not use this slot. This is a follow-on of the origibal patch below with a change in comments. https://reviews.llvm.org/rGa499051f10a2d0150b60c14493558476039f701a Reviewed by: hubert.reinterpretcast, cebowleratibm Differential Revision: https://reviews.llvm.org/D136257
Diffstat (limited to 'libcxxabi/src')
-rw-r--r--libcxxabi/src/aix_state_tab_eh.inc2
1 files changed, 1 insertions, 1 deletions
diff --git a/libcxxabi/src/aix_state_tab_eh.inc b/libcxxabi/src/aix_state_tab_eh.inc
index f5b229a9cab2..128a0ab34af7 100644
--- a/libcxxabi/src/aix_state_tab_eh.inc
+++ b/libcxxabi/src/aix_state_tab_eh.inc
@@ -559,7 +559,7 @@ __xlcxx_personality_v0(int version, _Unwind_Action actions, uint64_t exceptionCl
// reserved for compilers (SP + 3 * sizeof(uintptr_t)) in the stack of
// the caller of the function containing the landing pad (within the link
// area for the call to the latter) for __xlc_exception_handle()
- // to retrieve.
+ // to retrieve when it is called by the landing pad.
uintptr_t *currentSP = reinterpret_cast<uintptr_t*>(_Unwind_GetGR(context, 1));
uintptr_t *callersSP = reinterpret_cast<uintptr_t*>(currentSP[0]);
callersSP[3] = reinterpret_cast<uintptr_t>(unwind_exception);