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
2d419b7d
Commit
2d419b7d
authored
Oct 28, 2019
by
Jacek Caban
Committed by
Alexandre Julliard
Oct 28, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vbscript: Always pass arguments inside parentheses by value.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
216f7146
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
5 deletions
+26
-5
compile.c
dlls/vbscript/compile.c
+3
-0
interp.c
dlls/vbscript/interp.c
+17
-0
lang.vbs
dlls/vbscript/tests/lang.vbs
+5
-5
vbscript.h
dlls/vbscript/vbscript.h
+1
-0
No files found.
dlls/vbscript/compile.c
View file @
2d419b7d
...
...
@@ -417,6 +417,9 @@ static HRESULT compile_args(compile_ctx_t *ctx, expression_t *args, unsigned *re
if
(
FAILED
(
hres
))
return
hres
;
if
(
args
->
type
==
EXPR_BRACKETS
&&
!
push_instr
(
ctx
,
OP_deref
))
return
E_OUTOFMEMORY
;
arg_cnt
++
;
args
=
args
->
next
;
}
...
...
dlls/vbscript/interp.c
View file @
2d419b7d
...
...
@@ -1028,6 +1028,23 @@ static HRESULT interp_pop(exec_ctx_t *ctx)
return
S_OK
;
}
static
HRESULT
interp_deref
(
exec_ctx_t
*
ctx
)
{
VARIANT
copy
,
*
v
=
stack_top
(
ctx
,
0
);
HRESULT
hres
;
TRACE
(
"%s
\n
"
,
debugstr_variant
(
v
));
if
(
V_VT
(
v
)
!=
(
VT_BYREF
|
VT_VARIANT
))
return
S_OK
;
V_VT
(
&
copy
)
=
VT_EMPTY
;
hres
=
VariantCopy
(
&
copy
,
V_VARIANTREF
(
v
));
if
(
SUCCEEDED
(
hres
))
*
v
=
copy
;
return
hres
;
}
static
HRESULT
interp_new
(
exec_ctx_t
*
ctx
)
{
const
WCHAR
*
arg
=
ctx
->
instr
->
arg1
.
bstr
;
...
...
dlls/vbscript/tests/lang.vbs
View file @
2d419b7d
...
...
@@ -1277,11 +1277,11 @@ ok x(0) = 2, "x(0) = " & x(0)
x
=
Array
(
1
)
seta0
(
x
)
todo_wine_
ok
x
(
0
)
=
1
,
"x(0) = "
&
x
(
0
)
ok
x
(
0
)
=
1
,
"x(0) = "
&
x
(
0
)
x
=
Array
(
1
)
call
(((
seta0
)))
((
x
))
todo_wine_
ok
x
(
0
)
=
1
,
"x(0) = "
&
x
(
0
)
ok
x
(
0
)
=
1
,
"x(0) = "
&
x
(
0
)
x
=
Array
(
1
)
call
(((
seta0
)))
(
x
)
...
...
@@ -1293,7 +1293,7 @@ call ok(x(0)(0) = 2, "x(0)(0) = " & x(0)(0))
x
=
Array
(
Array
(
3
))
seta0
(
x
(
0
))
call
todo_wine_
ok
(
x
(
0
)(
0
)
=
3
,
"x(0)(0) = "
&
x
(
0
)(
0
))
call
ok
(
x
(
0
)(
0
)
=
3
,
"x(0)(0) = "
&
x
(
0
)(
0
))
y
=
(
seta0
)(
x
)
ok
y
=
1
,
"y = "
&
y
...
...
@@ -1311,7 +1311,7 @@ ok x(0) = 2, "x(0) = " & x(0)
x
=
Array
(
1
)
changearg
(
x
(
0
))
todo_wine_
ok
x
(
0
)
=
1
,
"x(0) = "
&
x
(
0
)
ok
x
(
0
)
=
1
,
"x(0) = "
&
x
(
0
)
Class
ArrClass
Dim
classarr
(
3
)
...
...
@@ -1377,7 +1377,7 @@ Call ok(arr(0) = "modified", "arr(0) = " & arr(0))
arr
(
0
)
=
"not modified"
modifyarr
(
arr
)
Call
todo_wine_
ok
(
arr
(
0
)
=
"not modified"
,
"arr(0) = "
&
arr
(
0
))
Call
ok
(
arr
(
0
)
=
"not modified"
,
"arr(0) = "
&
arr
(
0
))
for
x
=
0
to
UBound
(
arr
)
arr
(
x
)
=
x
...
...
dlls/vbscript/vbscript.h
View file @
2d419b7d
...
...
@@ -224,6 +224,7 @@ typedef enum {
X(case, 0, ARG_ADDR, 0) \
X(concat, 1, 0, 0) \
X(const, 1, ARG_BSTR, 0) \
X(deref, 1, 0, 0) \
X(dim, 1, ARG_BSTR, ARG_UINT) \
X(div, 1, 0, 0) \
X(double, 1, ARG_DOUBLE, 0) \
...
...
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