From: Francis De Brabandere <francisdb@gmail.com> --- dlls/vbscript/interp.c | 7 +++++++ dlls/vbscript/tests/lang.vbs | 16 ++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/dlls/vbscript/interp.c b/dlls/vbscript/interp.c index 127fcc2c05e..4940d737bf1 100644 --- a/dlls/vbscript/interp.c +++ b/dlls/vbscript/interp.c @@ -714,6 +714,13 @@ static HRESULT interp_vcall(exec_ctx_t *ctx) v = stack_pop(ctx); hres = variant_call(ctx, v, arg_cnt, &res); + if(SUCCEEDED(hres) && V_VT(&res) == (VT_BYREF|VT_VARIANT)) { + VARIANT tmp; + V_VT(&tmp) = VT_EMPTY; + hres = VariantCopyInd(&tmp, &res); + if(SUCCEEDED(hres)) + res = tmp; + } VariantClear(v); if(FAILED(hres)) return hres; diff --git a/dlls/vbscript/tests/lang.vbs b/dlls/vbscript/tests/lang.vbs index 0025bfeddcf..405c846f94a 100644 --- a/dlls/vbscript/tests/lang.vbs +++ b/dlls/vbscript/tests/lang.vbs @@ -1578,6 +1578,22 @@ ok arr2(1,2) = 2, "arr2(1,2) = " & arr2(1,2) x = Array(Array(3)) call ok(x(0)(0) = 3, "x(0)(0) = " & x(0)(0)) +Class ArrayReturnContainer + Public Default Property Get Item(key) + If key = "Key" Then + Item = Array("Value1", Array("SubValue1", "SubValue2")) + End If + End Property +End Class + +Dim containerObj +Set containerObj = New ArrayReturnContainer +call ok(containerObj.Item("Key")(0) = "Value1", "containerObj.Item(Key)(0) = " & containerObj.Item("Key")(0)) +call ok(containerObj.Item("Key")(1)(0) = "SubValue1", "containerObj.Item(Key)(1)(0) = " & containerObj.Item("Key")(1)(0)) +call ok(containerObj.Item("Key")(1)(1) = "SubValue2", "containerObj.Item(Key)(1)(1) = " & containerObj.Item("Key")(1)(1)) +call ok(containerObj("Key")(0) = "Value1", "containerObj(Key)(0) = " & containerObj("Key")(0)) +call ok(containerObj("Key")(1)(0) = "SubValue1", "containerObj(Key)(1)(0) = " & containerObj("Key")(1)(0)) + function seta0(arr) arr(0) = 2 seta0 = 1 -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10308