Title: ffi: Fast FFI bypasses `i32` range validation after V8 optimization · Issue #64690 · nodejs/node · GitHub
Open Graph Title: ffi: Fast FFI bypasses `i32` range validation after V8 optimization · Issue #64690 · nodejs/node
X Title: ffi: Fast FFI bypasses `i32` range validation after V8 optimization · Issue #64690 · nodejs/node
Description: Version main Platform macOS 26.5.2 Subsystem ffi What steps will reproduce the bug? import { dlopen } from 'node:ffi'; const { lib, functions } = dlopen(null, { abs: { arguments: ['i32'], return: 'i32' }, }); function call(value) { retur...
Open Graph Description: Version main Platform macOS 26.5.2 Subsystem ffi What steps will reproduce the bug? import { dlopen } from 'node:ffi'; const { lib, functions } = dlopen(null, { abs: { arguments: ['i32'], return: '...
X Description: Version main Platform macOS 26.5.2 Subsystem ffi What steps will reproduce the bug? import { dlopen } from 'node:ffi'; const { lib, functions } = dlopen(null, { abs: { arguments: ['i32&...
Opengraph URL: https://github.com/nodejs/node/issues/64690
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"ffi: Fast FFI bypasses `i32` range validation after V8 optimization","articleBody":"### Version\n\nmain\n\n### Platform\n\n```text\nmacOS 26.5.2\n```\n\n### Subsystem\n\nffi\n\n### What steps will reproduce the bug?\n\n```js\nimport { dlopen } from 'node:ffi';\n\nconst { lib, functions } = dlopen(null, {\n abs: { arguments: ['i32'], return: 'i32' },\n});\n\nfunction call(value) {\n return functions.abs(value);\n}\n\neval('%PrepareFunctionForOptimization(call)');\ncall(0);\ncall(0);\neval('%OptimizeFunctionOnNextCall(call)');\ncall(0);\n\nconsole.log(call(2 ** 32));\n\nlib.close();\n```\n\nRun with\n```console\n$ node --no-warnings --experimental-ffi --allow-natives-syntax repro.js\n```\n\n### How often does it reproduce? Is there a required condition?\n\nAlways\n\n### What is the expected behavior? Why is that the expected behavior?\n\nIt should throw `ERR_INVALID_ARG_VALUE` with `Argument 0 must be an int32`, as the generic FFI path does.\n\n### What do you see instead?\n\nThe optimized call accepts `2 ** 32`, truncates it to zero, and returns `0`\n\n### Additional information\n\n_No response_","author":{"url":"https://github.com/trivikr","@type":"Person","name":"trivikr"},"datePublished":"2026-07-23T06:30:16Z","url":"https://github.com/nodejs/node/issues/64690"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:71835b89-df58-a140-96d5-318b896df6bc |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B65A:147263:6DBE4B:943397:6AED286C |
| html-safe-nonce | 933eecafc3c0e3719ddb5617169dcc7501be6196e8665ba2e4be61b44266619e |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCNjVBOjE0NzI2Mzo2REJFNEI6OTQzMzk3OjZBRUQyODZDIiwidmlzaXRvcl9pZCI6IjU5NDg5MTAxNzY0MzE4NDM0MzYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 76af5f4d1a32efa2a7e0ed64de384406e5c6c4a19c7a2fe3eb47e96ef2a20ce8 |
| hovercard-subject-tag | issue:4956102880 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/nodejs/node/64690/issue_layout |
| twitter:image | https://opengraph.githubassets.com/522c9a29bef4f51926ebf836182d3f4c4adddb1242563c461b97ddb217e7abe0/nodejs/node/issues/64690 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/522c9a29bef4f51926ebf836182d3f4c4adddb1242563c461b97ddb217e7abe0/nodejs/node/issues/64690 |
| og:image:alt | Version main Platform macOS 26.5.2 Subsystem ffi What steps will reproduce the bug? import { dlopen } from 'node:ffi'; const { lib, functions } = dlopen(null, { abs: { arguments: ['i32'], return: '... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | trivikr |
| hostname | github.com |
| expected-hostname | github.com |
| None | 9d95365dda0576efe9b71f45807595e396bd0ca9286fba5367a05048e6ddf8f2 |
| turbo-cache-control | no-preview |
| go-import | github.com/nodejs/node git https://github.com/nodejs/node.git |
| octolytics-dimension-user_id | 9950313 |
| octolytics-dimension-user_login | nodejs |
| octolytics-dimension-repository_id | 27193779 |
| octolytics-dimension-repository_nwo | nodejs/node |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 27193779 |
| octolytics-dimension-repository_network_root_nwo | nodejs/node |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 98b41fa4b5635ceb45a4c54320fced73817ff290 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width