| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 922f2f0 commit b2fd003
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1799,7 +1799,18 @@ base::Optional<ParseResult> MakeNumberLiteralExpression( | |||
| 1799 | 1799 | // Meanwhile, we type it as constexpr float64 when out of int32 range. | |
| 1800 | 1800 | double value = 0; | |
| 1801 | 1801 | try { | |
| 1802 | + #if defined(V8_OS_SOLARIS) | ||
| 1803 | + // stod() on Solaris does not currently support hex strings. Use strtol() | ||
| 1804 | + // specifically for hex literals until stod() support is available. | ||
| 1805 | + if (number.find("0x") == std::string::npos && | ||
| 1806 | + number.find("0X") == std::string::npos) { | ||
| 1807 | + value = std::stod(number); | ||
| 1808 | + } else { | ||
| 1809 | + value = static_cast<double>(strtol(number.c_str(), nullptr, 0)); | ||
| 1810 | + } | ||
| 1811 | + #else | ||
| 1802 | 1812 | value = std::stod(number); | |
| 1813 | + #endif // !defined(V8_OS_SOLARIS) | ||
| 1803 | 1814 | } catch (const std::out_of_range&) { | |
| 1804 | 1815 | Error("double literal out-of-range").Throw(); | |
| 1805 | 1816 | } | |
| Back | FazBrowse Home | New Git URL |
0 commit comments