Skip to content

Commit

Permalink
buffer: use IntegerValue not Uin32Value to support copying buffers gr…
Browse files Browse the repository at this point in the history
…eater than 4GB in length on 64-bit systems
  • Loading branch information
duncpro committed Oct 22, 2024
1 parent b76bcb3 commit d15c192
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/node_buffer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -572,9 +572,9 @@ void SlowCopy(const FunctionCallbackInfo<Value>& args) {
ArrayBufferViewContents<char> source(args[0]);
SPREAD_BUFFER_ARG(args[1].As<Object>(), target);

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();
const auto target_start = args[2]->IntegerValue(env->context()).ToChecked();
const auto source_start = args[3]->IntegerValue(env->context()).ToChecked();
const auto to_copy = args[4]->IntegerValue(env->context()).ToChecked();

memmove(target_data + target_start, source.data() + source_start, to_copy);
args.GetReturnValue().Set(to_copy);
Expand Down

0 comments on commit d15c192

Please sign in to comment.