vbscript: Don't use function return value for call expressions.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50758 Signed-off-by: Robert Wilhelm <robert.wilhelm@gmx.net> Signed-off-by: Jacek Caban <jacek@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
2613f8bfe6
commit
4f5e5cc63f
|
@ -134,7 +134,8 @@ static HRESULT lookup_identifier(exec_ctx_t *ctx, BSTR name, vbdisp_invoke_type_
|
|||
DISPID id;
|
||||
HRESULT hres;
|
||||
|
||||
if((ctx->func->type == FUNC_FUNCTION || ctx->func->type == FUNC_PROPGET)
|
||||
if(invoke_type != VBDISP_CALLGET
|
||||
&& (ctx->func->type == FUNC_FUNCTION || ctx->func->type == FUNC_PROPGET)
|
||||
&& !wcsicmp(name, ctx->func->name)) {
|
||||
ref->type = REF_VAR;
|
||||
ref->u.v = &ctx->ret_val;
|
||||
|
@ -800,6 +801,13 @@ static HRESULT interp_ident(exec_ctx_t *ctx)
|
|||
|
||||
TRACE("%s\n", debugstr_w(identifier));
|
||||
|
||||
if((ctx->func->type == FUNC_FUNCTION || ctx->func->type == FUNC_PROPGET)
|
||||
&& !wcsicmp(identifier, ctx->func->name)) {
|
||||
V_VT(&v) = VT_BYREF|VT_VARIANT;
|
||||
V_BYREF(&v) = &ctx->ret_val;
|
||||
return stack_push(ctx, &v);
|
||||
}
|
||||
|
||||
hres = do_icall(ctx, &v, identifier, 0);
|
||||
if(FAILED(hres))
|
||||
return hres;
|
||||
|
|
|
@ -1882,6 +1882,30 @@ set arr(0) = new TestPropSyntax
|
|||
arr(0).prop = 1
|
||||
ok arr(0).prop = 1, "arr(0) = " & arr(0).prop
|
||||
|
||||
function recursingfunction(x)
|
||||
if (x) then exit function
|
||||
recursingfunction = 2
|
||||
dim y
|
||||
y = recursingfunction
|
||||
call ok(y = 2, "y = " & y)
|
||||
recursingfunction = 1
|
||||
call recursingfunction(True)
|
||||
end function
|
||||
call ok(recursingfunction(False) = 1, "unexpected return value " & recursingfunction(False))
|
||||
|
||||
x = false
|
||||
function recursingfunction2
|
||||
if (x) then exit function
|
||||
recursingfunction2 = 2
|
||||
dim y
|
||||
y = recursingfunction2
|
||||
call ok(y = 2, "y = " & y)
|
||||
recursingfunction2 = 1
|
||||
x = true
|
||||
recursingfunction2()
|
||||
end function
|
||||
call ok(recursingfunction2() = 1, "unexpected return value " & recursingfunction2())
|
||||
|
||||
function f2(x,y)
|
||||
end function
|
||||
|
||||
|
|
Loading…
Reference in New Issue