mirror of https://github.com/nodejs/node.git
src: fix integer overflow in GetNow
PR-URL: https://github.com/nodejs/node/pull/22214 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Bradley Farias <bradley.meck@gmail.com> Reviewed-By: Matheus Marchini <matheus@sthima.com> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>pull/22247/head
parent
c8aa83c6dd
commit
01a160a05d
|
@ -617,7 +617,7 @@ Local<Value> Environment::GetNow() {
|
|||
CHECK_GE(now, timer_base());
|
||||
now -= timer_base();
|
||||
if (now <= 0xffffffff)
|
||||
return Integer::New(isolate(), static_cast<uint32_t>(now));
|
||||
return Integer::NewFromUnsigned(isolate(), static_cast<uint32_t>(now));
|
||||
else
|
||||
return Number::New(isolate(), static_cast<double>(now));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue