ffi: validate 'void' as parameter type in getFunction and getFunctions#63504
Conversation
8b78e7a to
58e5f70
Compare
|
No, this is wrong. Don't validate at JS level but within C++ level please. |
455f25e to
06410ff
Compare
Moved validation into the native FFI signature parsing layer in src/ffi/types.cc as suggested. Also removed the temporary JS-side validation. |
06410ff to
618bed6
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #63504 +/- ##
========================================
Coverage 90.34% 90.34%
========================================
Files 730 730
Lines 234359 234468 +109
Branches 43923 43911 -12
========================================
+ Hits 211720 211823 +103
- Misses 14361 14373 +12
+ Partials 8278 8272 -6
🚀 New features to boost your workflow:
|
|
CI failures are relevant |
Hi @ShogunPanda, the Jenkins failures are from the old commit |
618bed6 to
43c1eb8
Compare
|
Fixed the Windows failure — DynamicLibrary(null) rejects null on Windows. Now using kernel32.dll on Windows and null on Unix. Sorry for the multiple runs! |
|
@Anshikakalpana unfortunately the failure still seems relevant. Can you please take a look? |
a28da0d to
5683e58
Compare
|
Still failing :( |
5683e58 to
78160bf
Compare
|
Update: found the issue — assert.throws with a regex matches against the error message, not the code. Fixed both assertions to use { code: 'ERR_INVALID_ARG_VALUE' }. Latest push should be green. |
|
@Anshikakalpana Now is the linter 😭 |
Fixes: nodejs#63461 Signed-off-by: Anshikakalpana <anshikajain196872@gmail.com>
78160bf to
401f456
Compare
|
Sorry! Trailing space on the blank line — fixed now. |
Commit Queue failed- Loading data for nodejs/node/pull/63504 ✔ Done loading data for nodejs/node/pull/63504 ----------------------------------- PR info ------------------------------------ Title ffi: validate 'void' as parameter type in getFunction and getFunctions (#63504) Author Anshika Jain <anshikajain196872@gmail.com> (@Anshikakalpana) Branch Anshikakalpana:ffi-void-parameter -> nodejs:main Labels needs-ci, ffi Commits 1 - ffi: validate 'void' as parameter type in getFunction and getFunctions Committers 1 - anshikakalpana <anshikajain196872@gmail.com> PR-URL: https://github.com/nodejs/node/pull/63504 Fixes: https://github.com/nodejs/node/issues/63461 Reviewed-By: Paolo Insogna <paolo@cowtech.it> ------------------------------ Generated metadata ------------------------------ PR-URL: https://github.com/nodejs/node/pull/63504 Fixes: https://github.com/nodejs/node/issues/63461 Reviewed-By: Paolo Insogna <paolo@cowtech.it> -------------------------------------------------------------------------------- ℹ This PR was created on Sat, 23 May 2026 09:00:33 GMT ✔ Approvals: 1 ✔ - Paolo Insogna (@ShogunPanda) (TSC): https://github.com/nodejs/node/pull/63504#pullrequestreview-4358414426 ✘ This PR needs to wait 75 more hours to land (or 0 minutes if there is one more approval) ✔ Last GitHub CI successful ℹ Last Full PR CI on 2026-05-26T20:10:13Z: https://ci.nodejs.org/job/node-test-pull-request/73757/ - Querying data for job/node-test-pull-request/73757/ ✔ Build data downloaded ✔ Last Jenkins CI successful -------------------------------------------------------------------------------- ✔ Aborted `git node land` session in /home/runner/work/node/node/.ncuhttps://github.com/nodejs/node/actions/runs/26495351583 |
|
Landed in 31c40f0 |
Fixes: #63461
Passing
'void'as a parameter type ingetFunctionorgetFunctionstriggers an internal assertion instead of a user-friendly error.In C,
voidin a parameter list means a function takes no arguments, expressed in Node.js FFI as an empty array[]. There is no valid use case for'void'as a parameter type.Fix:
add early validation in
getFunctionandgetFunctionsthat throwsERR_INVALID_ARG_VALUEwhen'void'appears in the parameters array, beforewrapWithSharedBufferis called.