Repository navigation
ffi: reject multi-argument buffer fast trampolines - #67046
Merged
nodejs-github-bot merged 1 commit intoNov 9, 2026
Merged
nodejs-github-bot merged 1 commit into
nodejs-github-bot merged 1 commit into
Conversation
Collaborator
|
Review requested:
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #67046 +/- ##
==========================================
- Coverage 90.73% 90.71% -0.02%
==========================================
Files 798 798
Lines 279993 279995 +2
Branches 53866 53857 -9
==========================================
- Hits 254047 254004 -43
- Misses 16229 16298 +69
+ Partials 9717 9693 -24
🚀 New features to boost your workflow:
|
The arm64 and x86_64 SysV emitters convert each buffer argument with a helper call after loading earlier arguments into their target registers. The call clobbers those registers, so the target would receive wrong values for every argument before the buffer. This is not reachable today: buffer-typed trampolines are generated only for single-argument signatures. Reject other shapes in the emitters so a future caller falls back instead of miscompiling. Signed-off-by: Trivikram Kamat <16024985+trivikr@users.noreply.github.com> Assisted-by: claude:opus-5.5
trivikr
force-pushed
the
ffi-arm64-fast-api-buffer-trampoline-args-2
branch
from
November 9, 2026 07:18
579dd76 to
5b8d358
Compare
ShogunPanda
approved these changes
Nov 9, 2026
Collaborator
Collaborator
Collaborator
|
Landed in 75d55af |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The arm64 and x86_64 SysV Fast API emitters convert a
bufferargument by callingnode_ffi_fast_buffer_data(). Arguments before the buffer are already in their target registers at that point, and the call clobbers them. For(i32, buffer)on arm64, the target receives(ptr, ptr).No JS call can reach this today. Buffer-typed trampolines are only generated for single-argument signatures (
SignatureNeedsFastBufferInvoke()), and the primary trampoline rewritesbuffertopointer.This change makes both emitters reject buffer signatures with more than one argument. That matches the only shape generated today, so a future multi-argument caller falls back to another call path instead of getting a broken trampoline. Win64 already rejects buffer arguments.
No test is added because no JS call can reach the rejected signature.
Assisted-by: claude:opus-5.5