Rotem Dan
Rotem Dan
I'm not sure what exactly the binding refers to, but I found [a candidate method](https://github.com/nodejs/node/blob/ee46d2297c648dc6cc8cbc0327c453514b878294/src/node_buffer.cc#L569) in the C++ code (at `node/src/node_buffer.cc`) that treats all arguments as Uint32: ```cpp // Assume...
If you simply search for the string `"uint32"` in [`node/src/node_buffer.cc`](https://github.com/nodejs/node/blob/ee46d2297c648dc6cc8cbc0327c453514b878294/src/node_buffer.cc), you'd realize that many other methods assume that indices are `uint32` (4 GiB max). Examples I've found: * [CopyArrayBuffer](https://github.com/nodejs/node/blob/ee46d2297c648dc6cc8cbc0327c453514b878294/src/node_buffer.cc#L1410) *...
It already supports large typed arrays (`new Uint8Array(>= 4 GiB)`) and buffers (`Buffer.alloc(>= 4 GiB)`) since version 22 (or earlier? not sure), which I think is great because it opened...
The fix should be really simple (couldn't test because I don't really know how to compile Node.js at the moment): In [SlowCopy](https://github.com/nodejs/node/blob/ee46d2297c648dc6cc8cbc0327c453514b878294/src/node_buffer.cc#L569C6-L569C14): change `->Uint32Value` to `->IntegerValue`, which would cause `target_start`,...
I've verified that changing: ```cpp const auto target_start = args[2]->Uint32Value(env->context()).ToChecked(); const auto source_start = args[3]->Uint32Value(env->context()).ToChecked(); const auto to_copy = args[4]->Uint32Value(env->context()).ToChecked(); ``` To: ```cpp const auto target_start = args[2]->IntegerValue(env->context()).ToChecked(); const auto...
Based on observations on the code, I realized the same problem should also occur in **`Buffer.copy`**. Turns out it did actually: Before fix:  After fix:  `Buffer.copy` is defined...