Title: ffi: int32/uint32 arguments reject -0 until the call is optimized · Issue #67033 · nodejs/node · GitHub
Open Graph Title: ffi: int32/uint32 arguments reject -0 until the call is optimized · Issue #67033 · nodejs/node
X Title: ffi: int32/uint32 arguments reject -0 until the call is optimized · Issue #67033 · nodejs/node
Description: Version main Platform macOS Subsystem ffi What steps will reproduce the bug? import { dlopen } from 'node:ffi'; const { functions: { abs } } = dlopen(null, { abs: { arguments: ['i32'], return: 'i32' }, }); function call(x) { try { return...
Open Graph Description: Version main Platform macOS Subsystem ffi What steps will reproduce the bug? import { dlopen } from 'node:ffi'; const { functions: { abs } } = dlopen(null, { abs: { arguments: ['i32'], return: 'i32...
X Description: Version main Platform macOS Subsystem ffi What steps will reproduce the bug? import { dlopen } from 'node:ffi'; const { functions: { abs } } = dlopen(null, { abs: { arguments: ['i32'...
Opengraph URL: https://github.com/nodejs/node/issues/67033
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"ffi: int32/uint32 arguments reject -0 until the call is optimized","articleBody":"### Version\n\nmain\n\n### Platform\n\n```text\nmacOS\n```\n\n### Subsystem\n\nffi\n\n### What steps will reproduce the bug?\n\n```js\nimport { dlopen } from 'node:ffi';\n\nconst { functions: { abs } } = dlopen(null, {\n abs: { arguments: ['i32'], return: 'i32' },\n});\n\nfunction call(x) {\n try { return abs(x); } catch (e) { return `${e.code}: ${e.message}`; }\n}\n\nconsole.log(call(-0));\n\nfunction hot(x) { return call(x); }\n%PrepareFunctionForOptimization(hot);\nfor (let i = 0; i \u003c 1000; i++) hot(i);\n%OptimizeFunctionOnNextCall(hot);\nhot(1);\nconsole.log(hot(-0));\n```\n\nRun it with\n```console\nnode --no-warnings --allow-natives-syntax repro.mjs\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\n```console\n0\n0\n```\n\n`-0` is an integer (`Number.isInteger(-0) === true`) and is within range for both types. Every other integer width (`int8`, `uint8`, `int16`, `uint16`, `int64`, `uint64`) accepts it, and so do the optimized Fast API and SharedBuffer paths.\n\n### What do you see instead?\n\n```console\nERR_INVALID_ARG_VALUE: Argument 0 must be an int32\n0\n```\n\n`uint32` behaves the same way (\"Argument 0 must be a uint32\").\n\n### Additional information\n\n_No response_","author":{"url":"https://github.com/trivikr","@type":"Person","name":"trivikr"},"datePublished":"2026-10-26T17:45:36Z","url":"https://github.com/nodejs/node/issues/67033"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| 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:8e2ba445-a6e6-76c3-1f6a-082eef408f36 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | DBBC:3E545B:4F51D6:6A8525:6AFBF019 |
| html-safe-nonce | cc7dc24ac90e544b83c9dd4253629c85b2cdf9b1c2d7008011ba3beee639c87d |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEQkJDOjNFNTQ1Qjo0RjUxRDY6NkE4NTI1OjZBRkJGMDE5IiwidmlzaXRvcl9pZCI6Ijc4MjI0Mzk1MTU4NDYwNzg0ODkiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 8c38540d2cb848d6009cb356539a662acd98b4f70ad653a184bc8836a38364fd |
| hovercard-subject-tag | issue:6045095260 |
| 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/67033/issue_layout |
| twitter:image | https://opengraph.githubassets.com/7fb02435b95e55bcad5c0e3cc001a67d6300e76c0abc72ad8454d0660ae63212/nodejs/node/issues/67033 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/7fb02435b95e55bcad5c0e3cc001a67d6300e76c0abc72ad8454d0660ae63212/nodejs/node/issues/67033 |
| og:image:alt | Version main Platform macOS Subsystem ffi What steps will reproduce the bug? import { dlopen } from 'node:ffi'; const { functions: { abs } } = dlopen(null, { abs: { arguments: ['i32'], return: 'i32... |
| 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 | fa74413a1d84dac536fcca0740780bcbd3207bafec0e51873b73ff8e8cca032f |
| 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 | b3b5633a74535d9c23385512d534c66c8fde1907 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width