Jacek Caban : vbscript: Ignore parentheses in call expression.

Alexandre Julliard julliard at winehq.org
Mon Oct 28 16:43:37 CDT 2019


Module: wine
Branch: master
Commit: 216f7146ef55d394baece2d96019f16f5e573a93
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=216f7146ef55d394baece2d96019f16f5e573a93

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Mon Oct 28 18:40:56 2019 +0100

vbscript: Ignore parentheses in call expression.

Signed-off-by: Jacek Caban <jacek at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/vbscript/compile.c      |  3 ++-
 dlls/vbscript/tests/lang.vbs | 14 ++++++++++++++
 2 files changed, 16 insertions(+), 1 deletion(-)

diff --git a/dlls/vbscript/compile.c b/dlls/vbscript/compile.c
index 0cbdae6e19..5acf4c005a 100644
--- a/dlls/vbscript/compile.c
+++ b/dlls/vbscript/compile.c
@@ -460,7 +460,8 @@ static HRESULT compile_call_expression(compile_ctx_t *ctx, call_expression_t *ex
     if(FAILED(hres))
         return hres;
 
-    call = expr->call_expr;
+    for(call = expr->call_expr; call->type == EXPR_BRACKETS; call = ((unary_expression_t*)call)->subexpr);
+
     if(call->type == EXPR_MEMBER)
         return compile_member_expression(ctx, (member_expression_t*)call, arg_cnt, ret_val);
 
diff --git a/dlls/vbscript/tests/lang.vbs b/dlls/vbscript/tests/lang.vbs
index 334de7aa0e..09c6b4f0ff 100644
--- a/dlls/vbscript/tests/lang.vbs
+++ b/dlls/vbscript/tests/lang.vbs
@@ -1279,6 +1279,14 @@ x = Array(1)
 seta0 (x)
 todo_wine_ok x(0) = 1, "x(0) = " & x(0)
 
+x = Array(1)
+call (((seta0))) ((x))
+todo_wine_ok x(0) = 1, "x(0) = " & x(0)
+
+x = Array(1)
+call (((seta0))) (x)
+ok x(0) = 2, "x(0) = " & x(0)
+
 x = Array(Array(3))
 seta0 x(0)
 call ok(x(0)(0) = 2, "x(0)(0) = " & x(0)(0))
@@ -1287,6 +1295,12 @@ x = Array(Array(3))
 seta0 (x(0))
 call todo_wine_ok(x(0)(0) = 3, "x(0)(0) = " & x(0)(0))
 
+y = (seta0)(x)
+ok y = 1, "y = " & y
+
+y = ((x))(0)
+ok y = 2, "y = " & y
+
 sub changearg(x)
     x = 2
 end sub




More information about the wine-cvs mailing list