Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
47f3abb6
Commit
47f3abb6
authored
Jan 27, 2020
by
Jacek Caban
Committed by
Alexandre Julliard
Jan 27, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vbscript: Fix VT_UNKNOWN handling in is expressions.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
1c194f3b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
57 deletions
+40
-57
interp.c
dlls/vbscript/interp.c
+39
-57
lang.vbs
dlls/vbscript/tests/lang.vbs
+1
-0
No files found.
dlls/vbscript/interp.c
View file @
47f3abb6
...
...
@@ -1928,75 +1928,57 @@ static HRESULT interp_case(exec_ctx_t *ctx)
return
S_OK
;
}
static
HRESULT
disp_cmp
(
IDispatch
*
disp1
,
IDispatch
*
disp2
,
VARIANT_BOOL
*
ret
)
static
HRESULT
interp_is
(
exec_ctx_t
*
ctx
)
{
I
ObjectIdentity
*
identity
;
IUnknown
*
unk1
,
*
unk2
;
HRESULT
hres
;
I
Unknown
*
l
=
NULL
,
*
r
=
NULL
;
variant_val_t
v
;
HRESULT
hres
=
S_OK
;
if
(
disp1
==
disp2
)
{
*
ret
=
VARIANT_TRUE
;
return
S_OK
;
}
TRACE
(
"
\n
"
);
if
(
!
disp1
||
!
disp2
)
{
*
ret
=
VARIANT_FALSE
;
return
S_OK
;
stack_pop_deref
(
ctx
,
&
v
);
if
(
V_VT
(
v
.
v
)
!=
VT_DISPATCH
&&
V_VT
(
v
.
v
)
!=
VT_UNKNOWN
)
{
FIXME
(
"Unhandled type %s
\n
"
,
debugstr_variant
(
v
.
v
));
hres
=
E_NOTIMPL
;
}
else
if
(
V_UNKNOWN
(
v
.
v
))
{
hres
=
IUnknown_QueryInterface
(
V_UNKNOWN
(
v
.
v
),
&
IID_IUnknown
,
(
void
**
)
&
r
);
}
hres
=
IDispatch_QueryInterface
(
disp1
,
&
IID_IUnknown
,
(
void
**
)
&
unk1
);
if
(
v
.
owned
)
VariantClear
(
v
.
v
);
if
(
FAILED
(
hres
))
return
hres
;
hres
=
IDispatch_QueryInterface
(
disp2
,
&
IID_IUnknown
,
(
void
**
)
&
unk2
);
if
(
FAILED
(
hres
))
{
IUnknown_Release
(
unk1
);
return
hres
;
}
if
(
unk1
==
unk2
)
{
*
ret
=
VARIANT_TRUE
;
}
else
{
hres
=
IUnknown_QueryInterface
(
unk1
,
&
IID_IObjectIdentity
,
(
void
**
)
&
identity
);
if
(
SUCCEEDED
(
hres
))
{
hres
=
IObjectIdentity_IsEqualObject
(
identity
,
unk2
);
IObjectIdentity_Release
(
identity
);
*
ret
=
hres
==
S_OK
?
VARIANT_TRUE
:
VARIANT_FALSE
;
}
else
{
*
ret
=
VARIANT_FALSE
;
}
stack_pop_deref
(
ctx
,
&
v
);
if
(
V_VT
(
v
.
v
)
!=
VT_DISPATCH
&&
V_VT
(
v
.
v
)
!=
VT_UNKNOWN
)
{
FIXME
(
"Unhandled type %s
\n
"
,
debugstr_variant
(
v
.
v
));
hres
=
E_NOTIMPL
;
}
else
if
(
V_UNKNOWN
(
v
.
v
))
{
hres
=
IUnknown_QueryInterface
(
V_UNKNOWN
(
v
.
v
),
&
IID_IUnknown
,
(
void
**
)
&
l
);
}
if
(
v
.
owned
)
VariantClear
(
v
.
v
);
IUnknown_Release
(
unk1
);
IUnknown_Release
(
unk2
);
return
S_OK
;
}
static
HRESULT
interp_is
(
exec_ctx_t
*
ctx
)
{
IDispatch
*
l
,
*
r
;
VARIANT
v
;
HRESULT
hres
;
TRACE
(
"
\n
"
);
hres
=
stack_pop_disp
(
ctx
,
&
r
);
if
(
FAILED
(
hres
))
return
hres
;
hres
=
stack_pop_disp
(
ctx
,
&
l
);
if
(
SUCCEEDED
(
hres
))
{
V_VT
(
&
v
)
=
VT_BOOL
;
hres
=
disp_cmp
(
l
,
r
,
&
V_BOOL
(
&
v
));
if
(
l
)
IDispatch_Release
(
l
);
VARIANT
res
;
V_VT
(
&
res
)
=
VT_BOOL
;
if
(
r
==
l
)
V_BOOL
(
&
res
)
=
VARIANT_TRUE
;
else
if
(
!
r
||
!
l
)
V_BOOL
(
&
res
)
=
VARIANT_FALSE
;
else
{
IObjectIdentity
*
identity
;
hres
=
IUnknown_QueryInterface
(
l
,
&
IID_IObjectIdentity
,
(
void
**
)
&
identity
);
if
(
SUCCEEDED
(
hres
))
{
hres
=
IObjectIdentity_IsEqualObject
(
identity
,
r
);
IObjectIdentity_Release
(
identity
);
}
V_BOOL
(
&
res
)
=
hres
==
S_OK
?
VARIANT_TRUE
:
VARIANT_FALSE
;
}
hres
=
stack_push
(
ctx
,
&
res
);
}
if
(
r
)
IDispatch_Release
(
r
);
if
(
FAILED
(
hres
))
return
hres
;
return
stack_push
(
ctx
,
&
v
);
IUnknown_Release
(
r
);
if
(
l
)
IUnknown_Release
(
l
);
return
hres
;
}
static
HRESULT
interp_concat
(
exec_ctx_t
*
ctx
)
...
...
dlls/vbscript/tests/lang.vbs
View file @
47f3abb6
...
...
@@ -1202,6 +1202,7 @@ set x = obj
call
ok
(
getVT
(
obj
)
=
"VT_UNKNOWN*"
,
"getVT(obj) = "
&
getVT
(
obj
))
call
ok
(
getVT
(
x
)
=
"VT_UNKNOWN*"
,
"getVT(x) = "
&
getVT
(
x
))
call
ok
(
getVT
(
unkObj
)
=
"VT_UNKNOWN"
,
"getVT(unkObj) = "
&
getVT
(
unkObj
))
call
ok
(
obj
is
unkObj
,
"obj is not unkObj"
)
' Array tests
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment