Skip to content

Commit 5b7419b

Browse files
apapirovskitargos
authored andcommitted
src: fix integer overflow in GetNow
PR-URL: #22214 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Bradley Farias <[email protected]> Reviewed-By: Matheus Marchini <[email protected]> Reviewed-By: Tiancheng "Timothy" Gu <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Сковорода Никита Андреевич <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]>
1 parent 999f55a commit 5b7419b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/env.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,7 @@ Local<Value> Environment::GetNow() {
536536
CHECK_GE(now, timer_base());
537537
now -= timer_base();
538538
if (now <= 0xffffffff)
539-
return Integer::New(isolate(), static_cast<uint32_t>(now));
539+
return Integer::NewFromUnsigned(isolate(), static_cast<uint32_t>(now));
540540
else
541541
return Number::New(isolate(), static_cast<double>(now));
542542
}

0 commit comments

Comments
 (0)