9e2c4771
by Francis De Brabandere at 2026-05-20T18:48:20+02:00
vbscript: Parse double literals via ucrtbase _wcstod_l.
The custom pow()-based real-number conversion was historical: when this
code was written, wine could not link against ucrtbase, so the lexer
reimplemented the conversion. That constraint is gone, and the custom
code had two correctness gaps - subnormal literals (e.g. 1e-309) rounded
to zero because pow(10, 309) overflows to infinity, and values near
DBL_MAX could round through the same infinity edge.
Hand the literal span to _wcstod_l with a C locale instead, which
handles rounding, subnormals, and overflow per IEEE 754 - and is
locale-invariant by construction, matching VBScript source semantics
where the decimal separator is always '.' regardless of runtime
SetLocale.
Above-DBL_MAX literals (1e309, 1.8e308) continue to raise err 1031 as
before.