From 3c366be35384790713d9cc5e06ab28dcda5bf50f Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Tue, 5 Nov 2019 14:08:47 +0100 Subject: [PATCH] vbscript: Lookup this object in lookup_identifier only if it's an actual VBScript object. Signed-off-by: Jacek Caban Signed-off-by: Alexandre Julliard --- dlls/vbscript/interp.c | 14 +++++++------- dlls/vbscript/tests/run.c | 6 ++++++ 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/dlls/vbscript/interp.c b/dlls/vbscript/interp.c index 4800ae7ce63..a74c6c320e7 100644 --- a/dlls/vbscript/interp.c +++ b/dlls/vbscript/interp.c @@ -139,14 +139,14 @@ static HRESULT lookup_identifier(exec_ctx_t *ctx, BSTR name, vbdisp_invoke_type_ return S_OK; } } - } - hres = disp_get_id(ctx->this_obj, name, invoke_type, TRUE, &id); - if(SUCCEEDED(hres)) { - ref->type = REF_DISP; - ref->u.d.disp = ctx->this_obj; - ref->u.d.id = id; - return S_OK; + hres = vbdisp_get_id(ctx->vbthis, name, invoke_type, TRUE, &id); + if(SUCCEEDED(hres)) { + ref->type = REF_DISP; + ref->u.d.disp = (IDispatch*)&ctx->vbthis->IDispatchEx_iface; + ref->u.d.id = id; + return S_OK; + } } } diff --git a/dlls/vbscript/tests/run.c b/dlls/vbscript/tests/run.c index 9ed1096a4dc..707fd894935 100644 --- a/dlls/vbscript/tests/run.c +++ b/dlls/vbscript/tests/run.c @@ -3025,6 +3025,12 @@ static void run_tests(void) parse_script_a("testOptionalArg 1,,2"); CHECK_CALLED(global_testoptionalarg_i); + parse_script_a("sub x()\n" + " dim y\n" + " y = cint(3)\n" + "end sub\n" + "x\n"); + strict_dispid_check = FALSE; SET_EXPECT(testobj_value_i);