Module: wine Branch: master Commit: 25248362ea670fa077d7f41af9bb67622bd8430f URL: https://source.winehq.org/git/wine.git/?a=commit;h=25248362ea670fa077d7f41af...
Author: Jacek Caban jacek@codeweavers.com Date: Mon Oct 28 18:40:18 2019 +0100
vbscript: Support non-member calls in compiler.
Signed-off-by: Jacek Caban jacek@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/vbscript/compile.c | 13 +++++++++---- dlls/vbscript/interp.c | 12 ++++++++++++ dlls/vbscript/vbscript.h | 4 +++- 3 files changed, 24 insertions(+), 5 deletions(-)
diff --git a/dlls/vbscript/compile.c b/dlls/vbscript/compile.c index 8309e5819c..0cbdae6e19 100644 --- a/dlls/vbscript/compile.c +++ b/dlls/vbscript/compile.c @@ -453,17 +453,22 @@ static HRESULT compile_member_expression(compile_ctx_t *ctx, member_expression_t static HRESULT compile_call_expression(compile_ctx_t *ctx, call_expression_t *expr, BOOL ret_val) { unsigned arg_cnt = 0; + expression_t *call; HRESULT hres;
hres = compile_args(ctx, expr->args, &arg_cnt); if(FAILED(hres)) return hres;
- if(expr->call_expr->type == EXPR_MEMBER) - return compile_member_expression(ctx, (member_expression_t*)expr->call_expr, arg_cnt, ret_val); + call = expr->call_expr; + if(call->type == EXPR_MEMBER) + return compile_member_expression(ctx, (member_expression_t*)call, arg_cnt, ret_val);
- FIXME("non-member call expression\n"); - return E_NOTIMPL; + hres = compile_expression(ctx, call); + if(FAILED(hres)) + return hres; + + return push_instr_uint(ctx, ret_val ? OP_vcall : OP_vcallv, arg_cnt); }
static HRESULT compile_unary_expression(compile_ctx_t *ctx, unary_expression_t *expr, vbsop_t op) diff --git a/dlls/vbscript/interp.c b/dlls/vbscript/interp.c index fee3e72959..d8ed679788 100644 --- a/dlls/vbscript/interp.c +++ b/dlls/vbscript/interp.c @@ -635,6 +635,18 @@ static HRESULT interp_icallv(exec_ctx_t *ctx) return do_icall(ctx, NULL); }
+static HRESULT interp_vcall(exec_ctx_t *ctx) +{ + FIXME("\n"); + return E_NOTIMPL; +} + +static HRESULT interp_vcallv(exec_ctx_t *ctx) +{ + FIXME("\n"); + return E_NOTIMPL; +} + static HRESULT do_mcall(exec_ctx_t *ctx, VARIANT *res) { const BSTR identifier = ctx->instr->arg1.bstr; diff --git a/dlls/vbscript/vbscript.h b/dlls/vbscript/vbscript.h index 71f42aaff9..0382a80290 100644 --- a/dlls/vbscript/vbscript.h +++ b/dlls/vbscript/vbscript.h @@ -220,7 +220,7 @@ typedef enum { X(assign_ident, 1, ARG_BSTR, ARG_UINT) \ X(assign_member, 1, ARG_BSTR, ARG_UINT) \ X(bool, 1, ARG_INT, 0) \ - X(catch, 1, ARG_ADDR, ARG_UINT) \ + X(catch, 1, ARG_ADDR, ARG_UINT) \ X(case, 0, ARG_ADDR, 0) \ X(concat, 1, 0, 0) \ X(const, 1, ARG_BSTR, 0) \ @@ -271,6 +271,8 @@ typedef enum { X(string, 1, ARG_STR, 0) \ X(sub, 1, 0, 0) \ X(val, 1, 0, 0) \ + X(vcall, 1, ARG_UINT, 0) \ + X(vcallv, 1, ARG_UINT, 0) \ X(xor, 1, 0, 0)
typedef enum {