[PATCH 0/1] MR10491: vbscript: Return error 1054 for Property Let/Set without arguments.
Add error productions in PropertyDecl that detect when Property Let or Property Set is declared without a parameter list. Windows returns error 1054 (Property Let/Set needs at least one argument) in this case. Previously Wine fell through to the generic E_FAIL path, returning error code 16389. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10491
From: Francis De Brabandere <francisdb@gmail.com> Add error productions in PropertyDecl that detect when Property Let or Property Set is declared without a parameter list. Windows returns error 1054 (Property Let/Set needs at least one argument) in this case. Previously Wine fell through to the generic E_FAIL path, returning error code 16389. --- dlls/vbscript/parser.y | 4 ++++ dlls/vbscript/tests/run.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/dlls/vbscript/parser.y b/dlls/vbscript/parser.y index c1a5b944268..7d40a462e97 100644 --- a/dlls/vbscript/parser.y +++ b/dlls/vbscript/parser.y @@ -497,6 +497,10 @@ PropertyDecl { $$ = new_function_decl(ctx, $4, FUNC_PROPLET, $1, $6, $9); CHECK_ERROR; } | Storage_opt tPROPERTY tSET Identifier '(' ArgumentDeclList ')' StSep BodyStatements tEND tPROPERTY { $$ = new_function_decl(ctx, $4, FUNC_PROPSET, $1, $6, $9); CHECK_ERROR; } + | Storage_opt tPROPERTY tLET Identifier error + { ctx->hres = MAKE_VBSERROR(VBSE_PROPERTY_LET_SET_NEEDS_ARG); YYABORT; } + | Storage_opt tPROPERTY tSET Identifier error + { ctx->hres = MAKE_VBSERROR(VBSE_PROPERTY_LET_SET_NEEDS_ARG); YYABORT; } FunctionDecl : Storage_opt tSUB Identifier StSep BodyStatements tEND tSUB diff --git a/dlls/vbscript/tests/run.c b/dlls/vbscript/tests/run.c index d3aebff098a..936aafd8f5e 100644 --- a/dlls/vbscript/tests/run.c +++ b/dlls/vbscript/tests/run.c @@ -3012,7 +3012,7 @@ static void test_parse_errors(void) /* Property Let/Set needs at least one argument - error 1054 */ L"Class C\nProperty Let x\nEnd Property\nEnd Class\n", 1, 14, - NULL, S_OK, -1054 + NULL, S_OK, 1054 }, { /* Unexpected 'Next' - error 1055 */ -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10491
participants (2)
-
Francis De Brabandere -
Francis De Brabandere (@francisdb)