ffi: preserve link register in ppc64 trampoline · nodejs/node@109ffcd · GitHub
Skip to content

Commit 109ffcd

Browse files
trivikraduh95
authored andcommitted
ffi: preserve link register in ppc64 trampoline
The ppc64 fast FFI trampoline uses `bl` to obtain the address used to load its target literal. This overwrites the caller's link register, so optimized FFI calls return into the trampoline and loop indefinitely. Save and restore the caller's link register around the branch. Also align the target literal for both even and odd GP argument counts. Signed-off-by: Kamat, Trivikram <16024985+trivikr@users.noreply.github.com> Assisted-by: codex:gpt-5.6-sol PR-URL: #64792 Reviewed-By: Paolo Insogna <paolo@cowtech.it> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
1 parent e0f0830 commit 109ffcd

1 file changed

Lines changed: 15 additions & 7 deletions

File tree

src/ffi/platforms/ppc64.cc

Lines changed: 15 additions & 7 deletions

0 commit comments

Comments
 (0)