summaryrefslogtreecommitdiff
path: root/deps/v8/third_party/inspector_protocol/lib/Parser_cpp.template
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/third_party/inspector_protocol/lib/Parser_cpp.template')
-rw-r--r--deps/v8/third_party/inspector_protocol/lib/Parser_cpp.template5
1 files changed, 2 insertions, 3 deletions
diff --git a/deps/v8/third_party/inspector_protocol/lib/Parser_cpp.template b/deps/v8/third_party/inspector_protocol/lib/Parser_cpp.template
index f3dde5ac21..ea27652096 100644
--- a/deps/v8/third_party/inspector_protocol/lib/Parser_cpp.template
+++ b/deps/v8/third_party/inspector_protocol/lib/Parser_cpp.template
@@ -425,9 +425,8 @@ std::unique_ptr<Value> buildValue(const Char* start, const Char* end, const Char
double value = charactersToDouble(tokenStart, tokenEnd - tokenStart, &ok);
if (!ok)
return nullptr;
- int number = static_cast<int>(value);
- if (number == value)
- result = FundamentalValue::create(number);
+ if (value >= INT_MIN && value <= INT_MAX && static_cast<int>(value) == value)
+ result = FundamentalValue::create(static_cast<int>(value));
else
result = FundamentalValue::create(value);
break;