Repository navigation
Conversation
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 the unsupported shape 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
Collaborator
|
Review requested:
|
Member
Author
|
Superseded by #67046, which rejects buffer trampolines with more than one argument instead of only those where the buffer isn't first. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #67045 +/- ##
==========================================
- Coverage 90.66% 90.65% -0.01%
==========================================
Files 797 797
Lines 278268 278270 +2
Branches 53521 53521
==========================================
- Hits 252280 252259 -21
- Misses 16382 16386 +4
- Partials 9606 9625 +19
🚀 New features to boost your workflow:
|
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 a
bufferargument that isn't the first GP argument. A future multi-argument caller then 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