Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
79f39c2a
Commit
79f39c2a
authored
Oct 18, 2019
by
Jacek Caban
Committed by
Alexandre Julliard
Oct 18, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vbscript: Fix NULL IDispatch handling in get_disp_value.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
087adea7
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
40 additions
and
9 deletions
+40
-9
interp.c
dlls/vbscript/interp.c
+14
-9
lang.vbs
dlls/vbscript/tests/lang.vbs
+22
-0
vbdisp.c
dlls/vbscript/vbdisp.c
+2
-0
vbscript.rc
dlls/vbscript/vbscript.rc
+1
-0
vbscript_defs.h
dlls/vbscript/vbscript_defs.h
+1
-0
No files found.
dlls/vbscript/interp.c
View file @
79f39c2a
...
...
@@ -319,7 +319,7 @@ static HRESULT stack_pop_val(exec_ctx_t *ctx, variant_val_t *r)
HRESULT
hres
;
hres
=
get_disp_value
(
ctx
->
script
,
V_DISPATCH
(
r
->
v
),
&
r
->
store
);
if
(
r
->
owned
)
if
(
r
->
owned
&&
V_DISPATCH
(
r
->
v
)
)
IDispatch_Release
(
V_DISPATCH
(
r
->
v
));
if
(
FAILED
(
hres
))
return
hres
;
...
...
@@ -350,7 +350,8 @@ static HRESULT stack_assume_val(exec_ctx_t *ctx, unsigned n)
disp
=
V_DISPATCH
(
v
);
hres
=
get_disp_value
(
ctx
->
script
,
disp
,
v
);
IDispatch_Release
(
disp
);
if
(
disp
)
IDispatch_Release
(
disp
);
if
(
FAILED
(
hres
))
return
hres
;
}
...
...
@@ -688,23 +689,27 @@ static HRESULT interp_mcallv(exec_ctx_t *ctx)
static
HRESULT
assign_value
(
exec_ctx_t
*
ctx
,
VARIANT
*
dst
,
VARIANT
*
src
,
WORD
flags
)
{
VARIANT
value
;
HRESULT
hres
;
hres
=
VariantCopyInd
(
dst
,
src
);
V_VT
(
&
value
)
=
VT_EMPTY
;
hres
=
VariantCopyInd
(
&
value
,
src
);
if
(
FAILED
(
hres
))
return
hres
;
if
(
V_VT
(
dst
)
==
VT_DISPATCH
&&
!
(
flags
&
DISPATCH_PROPERTYPUTREF
))
{
VARIANT
value
;
if
(
V_VT
(
&
value
)
==
VT_DISPATCH
&&
!
(
flags
&
DISPATCH_PROPERTYPUTREF
))
{
IDispatch
*
disp
=
V_DISPATCH
(
&
value
)
;
hres
=
get_disp_value
(
ctx
->
script
,
V_DISPATCH
(
dst
),
&
value
);
IDispatch_Release
(
V_DISPATCH
(
dst
));
V_VT
(
&
value
)
=
VT_EMPTY
;
hres
=
get_disp_value
(
ctx
->
script
,
disp
,
&
value
);
if
(
disp
)
IDispatch_Release
(
disp
);
if
(
FAILED
(
hres
))
return
hres
;
*
dst
=
value
;
}
VariantClear
(
dst
);
*
dst
=
value
;
return
S_OK
;
}
...
...
dlls/vbscript/tests/lang.vbs
View file @
79f39c2a
...
...
@@ -1354,6 +1354,28 @@ end class
set
x
=
new
RegExp
Call
ok
(
x
.
Global
=
false
,
"x.Global = "
&
x
.
Global
)
sub
test_nothing_errors
dim
x
on
error
resume
next
x
=
1
err
.
clear
x
=
nothing
call
ok
(
err
.
number
=
91
,
"err.number = "
&
err
.
number
)
call
ok
(
x
=
1
,
"x = "
&
x
)
err
.
clear
x
=
not
nothing
call
ok
(
err
.
number
=
91
,
"err.number = "
&
err
.
number
)
call
ok
(
x
=
1
,
"x = "
&
x
)
err
.
clear
x
=
""
&
nothing
call
ok
(
err
.
number
=
91
,
"err.number = "
&
err
.
number
)
call
ok
(
x
=
1
,
"x = "
&
x
)
end
sub
call
test_nothing_errors
()
sub
test_identifiers
' test keywords that can also be a declared identifier
Dim
default
...
...
dlls/vbscript/vbdisp.c
View file @
79f39c2a
...
...
@@ -967,6 +967,8 @@ HRESULT disp_call(script_ctx_t *ctx, IDispatch *disp, DISPID id, DISPPARAMS *dp,
HRESULT
get_disp_value
(
script_ctx_t
*
ctx
,
IDispatch
*
disp
,
VARIANT
*
v
)
{
DISPPARAMS
dp
=
{
NULL
};
if
(
!
disp
)
return
MAKE_VBSERROR
(
VBSE_OBJECT_VARIABLE_NOT_SET
);
return
disp_call
(
ctx
,
disp
,
DISPID_VALUE
,
&
dp
,
v
);
}
...
...
dlls/vbscript/vbscript.rc
View file @
79f39c2a
...
...
@@ -37,6 +37,7 @@ STRINGTABLE
VBSE_PERMISSION_DENIED "Permission denied"
VBSE_PATH_FILE_ACCESS "Path/File access error"
VBSE_PATH_NOT_FOUND "Path not found"
VBSE_OBJECT_VARIABLE_NOT_SET "Object variable not set"
VBSE_ILLEGAL_NULL_USE "Invalid use of Null"
VBSE_CANT_CREATE_TMP_FILE "Can't create necessary temporary file"
VBSE_CANT_CREATE_OBJECT "ActiveX component can't create object"
...
...
dlls/vbscript/vbscript_defs.h
View file @
79f39c2a
...
...
@@ -250,6 +250,7 @@
#define VBSE_PERMISSION_DENIED 70
#define VBSE_PATH_FILE_ACCESS 75
#define VBSE_PATH_NOT_FOUND 76
#define VBSE_OBJECT_VARIABLE_NOT_SET 91
#define VBSE_ILLEGAL_NULL_USE 94
#define VBSE_CANT_CREATE_TMP_FILE 322
#define VBSE_CANT_CREATE_OBJECT 429
...
...
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