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
62bc8aeb
Commit
62bc8aeb
authored
Mar 03, 2015
by
Jacek Caban
Committed by
Alexandre Julliard
Mar 03, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vbscript: Leave assigning value up to add_dynamic_var callers.
parent
86283b31
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
19 deletions
+16
-19
interp.c
dlls/vbscript/interp.c
+16
-19
No files found.
dlls/vbscript/interp.c
View file @
62bc8aeb
...
...
@@ -220,13 +220,12 @@ static HRESULT lookup_identifier(exec_ctx_t *ctx, BSTR name, vbdisp_invoke_type_
}
static
HRESULT
add_dynamic_var
(
exec_ctx_t
*
ctx
,
const
WCHAR
*
name
,
BOOL
is_const
,
VARIANT
*
val
,
BOOL
own_val
,
VARIANT
*
*
out_var
)
BOOL
is_const
,
VARIANT
**
out_var
)
{
dynamic_var_t
*
new_var
;
heap_pool_t
*
heap
;
WCHAR
*
str
;
unsigned
size
;
HRESULT
hres
;
heap
=
ctx
->
func
->
type
==
FUNC_GLOBAL
?
&
ctx
->
script
->
heap
:
&
ctx
->
heap
;
...
...
@@ -241,15 +240,7 @@ static HRESULT add_dynamic_var(exec_ctx_t *ctx, const WCHAR *name,
memcpy
(
str
,
name
,
size
);
new_var
->
name
=
str
;
new_var
->
is_const
=
is_const
;
if
(
own_val
)
{
new_var
->
v
=
*
val
;
}
else
{
V_VT
(
&
new_var
->
v
)
=
VT_EMPTY
;
hres
=
VariantCopy
(
&
new_var
->
v
,
val
);
if
(
FAILED
(
hres
))
return
hres
;
}
if
(
ctx
->
func
->
type
==
FUNC_GLOBAL
)
{
new_var
->
next
=
ctx
->
script
->
global_vars
;
...
...
@@ -259,9 +250,7 @@ static HRESULT add_dynamic_var(exec_ctx_t *ctx, const WCHAR *name,
ctx
->
dynamic_vars
=
new_var
;
}
if
(
out_var
)
*
out_var
=
&
new_var
->
v
;
return
S_OK
;
}
...
...
@@ -620,9 +609,8 @@ static HRESULT do_icall(exec_ctx_t *ctx, VARIANT *res)
break
;
case
REF_NONE
:
if
(
res
&&
!
ctx
->
func
->
code_ctx
->
option_explicit
&&
arg_cnt
==
0
)
{
VARIANT
v
,
*
new
;
VariantInit
(
&
v
);
hres
=
add_dynamic_var
(
ctx
,
identifier
,
FALSE
,
&
v
,
FALSE
,
&
new
);
VARIANT
*
new
;
hres
=
add_dynamic_var
(
ctx
,
identifier
,
FALSE
,
&
new
);
if
(
FAILED
(
hres
))
return
hres
;
V_VT
(
res
)
=
VT_BYREF
|
VT_VARIANT
;
...
...
@@ -778,13 +766,17 @@ static HRESULT assign_ident(exec_ctx_t *ctx, BSTR name, WORD flags, DISPPARAMS *
FIXME
(
"throw exception
\n
"
);
hres
=
E_FAIL
;
}
else
{
VARIANT
*
new_var
;
if
(
arg_cnt
(
dp
))
{
FIXME
(
"arg_cnt %d not supported
\n
"
,
arg_cnt
(
dp
));
return
E_NOTIMPL
;
}
TRACE
(
"creating variable %s
\n
"
,
debugstr_w
(
name
));
hres
=
add_dynamic_var
(
ctx
,
name
,
FALSE
,
dp
->
rgvarg
,
FALSE
,
NULL
);
hres
=
add_dynamic_var
(
ctx
,
name
,
FALSE
,
&
new_var
);
if
(
SUCCEEDED
(
hres
))
hres
=
VariantCopyInd
(
new_var
,
dp
->
rgvarg
);
}
}
...
...
@@ -920,7 +912,7 @@ static HRESULT interp_set_member(exec_ctx_t *ctx)
static
HRESULT
interp_const
(
exec_ctx_t
*
ctx
)
{
BSTR
arg
=
ctx
->
instr
->
arg1
.
bstr
;
variant_val_t
val
;
VARIANT
*
v
;
ref_t
ref
;
HRESULT
hres
;
...
...
@@ -937,11 +929,16 @@ static HRESULT interp_const(exec_ctx_t *ctx)
return
E_FAIL
;
}
hres
=
stack_
pop_val
(
ctx
,
&
val
);
hres
=
stack_
assume_val
(
ctx
,
0
);
if
(
FAILED
(
hres
))
return
hres
;
return
add_dynamic_var
(
ctx
,
arg
,
TRUE
,
val
.
v
,
val
.
owned
,
NULL
);
hres
=
add_dynamic_var
(
ctx
,
arg
,
TRUE
,
&
v
);
if
(
FAILED
(
hres
))
return
hres
;
*
v
=
*
stack_pop
(
ctx
);
return
S_OK
;
}
static
HRESULT
interp_val
(
exec_ctx_t
*
ctx
)
...
...
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