mirror of
https://github.com/boykopovar/AnyPS5.git
synced 2026-11-05 13:20:11 +00:00
Implement the six WTF::charactersToDouble and WTF::charactersToFloat overloads for Latin-1 and UTF-16 input and the four static WTF::double_conversion::StringToDoubleConverter StringToDouble and StringToFloat overloads for char and uint16_t input, following pinned public WebKit. One parser follows StringToIeee: the number grammar, the 772-digit cut with a sticky digit, the exponent saturation and the processed length. charactersToDouble and charactersToFloat add toDoubleType's leading ASCII spaces and ok/parsedLength results, map UTF-16 code units above 0x7F to 0 and round the float overloads through double. StringToDoubleConverter reads the code units as they are, skips no spaces and rounds StringToFloat directly to float as Strtof does. Null characters with a nonzero length and a null processed length throw where WebKit faults, a decimal exponent that leaves the range of WebKit's int throws where WebKit overflows, and a UTF-16 charactersTo* length above UINT32_MAX throws where WebKit's conversion Vector crashes.