akirilov-arm opened PR #4851 from get_return_address to main:
The previous implementation assumed that nothing had clobbered the LR register since the current function had started executing, so it would be incorrect for a non-leaf function, for example, that contains the
get_return_addressoperation right after a call. The operation is valid only if thepreserve_frame_pointersflag is enabled, which implies that the presence of a frame record on the stack is guaranteed.
cfallin created PR review comment:
Can we add a comment here describing the reload? I think this is so that we know that
LRis in a consistent state (the original signed return address), even if anotherget_return_addressop had already been executed; is that right? And then it's safe to clobber below withxpaclribecausepreserve_frame_pointersimplies thatLRwill be reloaded before return?
cfallin submitted PR review.
cfallin submitted PR review.
akirilov-arm updated PR #4851 from get_return_address to main.
akirilov-arm created PR review comment:
Actually the main issue is not other
get_return_addressoperations, but rather function calls - I added the documentation.
akirilov-arm submitted PR review.
cfallin submitted PR review.
cfallin merged PR #4851.
Last updated: Dec 13 2025 at 19:03 UTC