Robert Wilhelm : vbscript: Remove overzealous check in parse_hex_literal.
Module: wine Branch: master Commit: 9821da55469bed316dbe2e6b54273da742ad3450 URL: https://source.winehq.org/git/wine.git/?a=commit;h=9821da55469bed316dbe2e6b5... Author: Robert Wilhelm <robert.wilhelm(a)gmx.net> Date: Fri Nov 27 17:33:21 2020 +0100 vbscript: Remove overzealous check in parse_hex_literal. is_identifier_char also triggers on logical operators like "or". Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50179 Signed-off-by: Robert Wilhelm <robert.wilhelm(a)gmx.net> Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/vbscript/lex.c | 2 +- dlls/vbscript/tests/lang.vbs | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/dlls/vbscript/lex.c b/dlls/vbscript/lex.c index e98ed98e194..357cad7158c 100644 --- a/dlls/vbscript/lex.c +++ b/dlls/vbscript/lex.c @@ -315,7 +315,7 @@ static int parse_hex_literal(parser_ctx_t *ctx, LONG *ret) while((d = hex_to_int(*++ctx->ptr)) != -1) l = l*16 + d; - if(begin + 9 /* max digits+1 */ < ctx->ptr || (*ctx->ptr != '&' && is_identifier_char(*ctx->ptr))) { + if(begin + 9 /* max digits+1 */ < ctx->ptr) { FIXME("invalid literal\n"); return 0; } diff --git a/dlls/vbscript/tests/lang.vbs b/dlls/vbscript/tests/lang.vbs index 419a4349896..a716cdbc65f 100644 --- a/dlls/vbscript/tests/lang.vbs +++ b/dlls/vbscript/tests/lang.vbs @@ -60,6 +60,7 @@ Call ok(&hfffe = -2, "&hfffe <> -2") Call ok(&hffff& = 65535, "&hffff& <> -1") Call ok(&hfffe& = 65534, "&hfffe& <> -2") Call ok(&hffffffff& = -1, "&hffffffff& <> -1") +Call ok((&h01or&h02)=3,"&h01or&h02 <> 3") W = 5 Call ok(W = 5, "W = " & W & " expected " & 5)
participants (1)
-
Alexandre Julliard