Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alexey Alyaev
wine
Commits
020d0695
Commit
020d0695
authored
13 years ago
by
Jacek Caban
Committed by
Alexandre Julliard
13 years ago
Browse files
Options
Downloads
Patches
Plain Diff
vbscript: Moved creating new dynamic variable to separated function.
parent
a9681662
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dlls/vbscript/interp.c
+44
-38
44 additions, 38 deletions
dlls/vbscript/interp.c
with
44 additions
and
38 deletions
dlls/vbscript/interp.c
+
44
−
38
View file @
020d0695
...
...
@@ -198,6 +198,46 @@ static HRESULT lookup_identifier(exec_ctx_t *ctx, BSTR name, vbdisp_invoke_type_
return
S_OK
;
}
static
HRESULT
add_dynamic_var
(
exec_ctx_t
*
ctx
,
const
WCHAR
*
name
,
VARIANT
*
val
,
BOOL
own_val
)
{
dynamic_var_t
*
new_var
;
vbsheap_t
*
heap
;
WCHAR
*
str
;
unsigned
size
;
HRESULT
hres
;
heap
=
ctx
->
func
->
type
==
FUNC_GLOBAL
?
&
ctx
->
script
->
heap
:
&
ctx
->
heap
;
new_var
=
vbsheap_alloc
(
heap
,
sizeof
(
*
new_var
));
if
(
!
new_var
)
return
E_OUTOFMEMORY
;
size
=
(
strlenW
(
name
)
+
1
)
*
sizeof
(
WCHAR
);
str
=
vbsheap_alloc
(
heap
,
size
);
if
(
!
str
)
return
E_OUTOFMEMORY
;
memcpy
(
str
,
name
,
size
);
new_var
->
name
=
str
;
if
(
own_val
)
{
new_var
->
v
=
*
val
;
}
else
{
hres
=
VariantCopy
(
&
new_var
->
v
,
val
);
if
(
FAILED
(
hres
))
return
hres
;
}
if
(
ctx
->
func
->
type
==
FUNC_GLOBAL
)
{
new_var
->
next
=
ctx
->
script
->
global_vars
;
ctx
->
script
->
global_vars
=
new_var
;
}
else
{
new_var
->
next
=
ctx
->
dynamic_vars
;
ctx
->
dynamic_vars
=
new_var
;
}
return
S_OK
;
}
static
inline
VARIANT
*
stack_pop
(
exec_ctx_t
*
ctx
)
{
assert
(
ctx
->
top
);
...
...
@@ -491,49 +531,15 @@ static HRESULT assign_ident(exec_ctx_t *ctx, BSTR name, VARIANT *val, BOOL own_v
case
REF_OBJ
:
FIXME
(
"REF_OBJ
\n
"
);
return
E_NOTIMPL
;
case
REF_NONE
:
{
dynamic_var_t
*
new_var
;
vbsheap_t
*
heap
;
WCHAR
*
str
;
unsigned
size
;
case
REF_NONE
:
if
(
ctx
->
func
->
code_ctx
->
option_explicit
)
{
FIXME
(
"throw exception
\n
"
);
return
E_FAIL
;
}
TRACE
(
"creating variable %s
\n
"
,
debugstr_w
(
name
));
heap
=
ctx
->
func
->
type
==
FUNC_GLOBAL
?
&
ctx
->
script
->
heap
:
&
ctx
->
heap
;
new_var
=
vbsheap_alloc
(
heap
,
sizeof
(
*
new_var
));
if
(
!
new_var
)
return
E_OUTOFMEMORY
;
size
=
(
strlenW
(
name
)
+
1
)
*
sizeof
(
WCHAR
);
str
=
vbsheap_alloc
(
heap
,
size
);
if
(
!
str
)
return
E_OUTOFMEMORY
;
memcpy
(
str
,
name
,
size
);
new_var
->
name
=
str
;
if
(
own_val
)
{
new_var
->
v
=
*
val
;
}
else
{
hres
=
VariantCopy
(
&
new_var
->
v
,
val
);
if
(
FAILED
(
hres
))
return
hres
;
}
if
(
ctx
->
func
->
type
==
FUNC_GLOBAL
)
{
new_var
->
next
=
ctx
->
script
->
global_vars
;
ctx
->
script
->
global_vars
=
new_var
;
hres
=
E_FAIL
;
}
else
{
new_var
->
next
=
ctx
->
dynamic_vars
;
ctx
->
dynamic_vars
=
new
_va
r
;
TRACE
(
"creating variable %s
\n
"
,
debugstr_w
(
name
))
;
hres
=
add_dynamic_var
(
ctx
,
name
,
val
,
own
_va
l
)
;
}
}
}
return
hres
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment