Skip to content

Commit 03d27e2

Browse files
committed
use IntegerValue instead of Uin32Value to support copying buffers greater than 4GB in length on 64-bit systems
1 parent b76bcb3 commit 03d27e2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/node_buffer.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -572,9 +572,9 @@ void SlowCopy(const FunctionCallbackInfo<Value>& args) {
572572
ArrayBufferViewContents<char> source(args[0]);
573573
SPREAD_BUFFER_ARG(args[1].As<Object>(), target);
574574

575-
const auto target_start = args[2]->Uint32Value(env->context()).ToChecked();
576-
const auto source_start = args[3]->Uint32Value(env->context()).ToChecked();
577-
const auto to_copy = args[4]->Uint32Value(env->context()).ToChecked();
575+
const auto target_start = args[2]->IntegerValue(env->context()).ToChecked();
576+
const auto source_start = args[3]->IntegerValue(env->context()).ToChecked();
577+
const auto to_copy = args[4]->IntegerValue(env->context()).ToChecked();
578578

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

0 commit comments

Comments
 (0)