Jacek Caban (@jacek) commented about dlls/vbscript/lex.c:
- if(use_int && (LONG)d == d) { + if(!is_double && !overflow && (LONG)d == d) { *(LONG*)ret = d; return tInt; }
- r = exp>=0 ? d*pow(10, exp) : d/pow(10, -exp); - if(isinf(r)) { + /* Delegate the real-number conversion to ucrtbase's locale-aware parser + * with a C locale, which handles rounding, subnormals, and overflow per + * IEEE 754. The lexer above has already determined the literal span; we + * just need to hand wcstod a null-terminated copy. */ + len = ctx->ptr - start; + if(len >= ARRAY_SIZE(buf)) + return lex_error(ctx, MAKE_VBSERROR(VBSE_INVALID_NUMBER));
Technically, number literals may have any number of characters (like trailing decimal zeroes). Unless native has an upper limit, we may need to dynamically allocate the buffer. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10937#note_140588