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
01e2bea1
Commit
01e2bea1
authored
Sep 08, 2011
by
Jacek Caban
Committed by
Alexandre Julliard
Sep 08, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vbscript: Added interp_bool implementation.
parent
ded37832
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
53 additions
and
2 deletions
+53
-2
interp.c
dlls/vbscript/interp.c
+53
-2
No files found.
dlls/vbscript/interp.c
View file @
01e2bea1
...
...
@@ -29,6 +29,10 @@ typedef struct {
vbscode_t
*
code
;
instr_t
*
instr
;
script_ctx_t
*
script
;
unsigned
stack_size
;
unsigned
top
;
VARIANT
*
stack
;
}
exec_ctx_t
;
typedef
HRESULT
(
*
instr_func_t
)(
exec_ctx_t
*
);
...
...
@@ -72,6 +76,37 @@ static HRESULT lookup_identifier(exec_ctx_t *ctx, BSTR name, ref_t *ref)
return
S_OK
;
}
static
inline
VARIANT
*
stack_pop
(
exec_ctx_t
*
ctx
)
{
assert
(
ctx
->
top
);
return
ctx
->
stack
+
--
ctx
->
top
;
}
static
HRESULT
stack_push
(
exec_ctx_t
*
ctx
,
VARIANT
*
v
)
{
if
(
ctx
->
stack_size
==
ctx
->
top
)
{
VARIANT
*
new_stack
;
new_stack
=
heap_realloc
(
ctx
->
stack
,
ctx
->
stack_size
*
2
);
if
(
!
new_stack
)
{
VariantClear
(
v
);
return
E_OUTOFMEMORY
;
}
ctx
->
stack
=
new_stack
;
ctx
->
stack_size
*=
2
;
}
ctx
->
stack
[
ctx
->
top
++
]
=
*
v
;
return
S_OK
;
}
static
void
stack_popn
(
exec_ctx_t
*
ctx
,
unsigned
n
)
{
while
(
n
--
)
VariantClear
(
stack_pop
(
ctx
));
}
static
HRESULT
interp_icallv
(
exec_ctx_t
*
ctx
)
{
BSTR
identifier
=
ctx
->
instr
->
arg1
.
bstr
;
...
...
@@ -115,8 +150,14 @@ static HRESULT interp_ret(exec_ctx_t *ctx)
static
HRESULT
interp_bool
(
exec_ctx_t
*
ctx
)
{
FIXME
(
"
\n
"
);
return
E_NOTIMPL
;
const
VARIANT_BOOL
arg
=
ctx
->
instr
->
arg1
.
lng
;
VARIANT
v
;
TRACE
(
"%s
\n
"
,
arg
?
"true"
:
"false"
);
V_VT
(
&
v
)
=
VT_BOOL
;
V_BOOL
(
&
v
)
=
arg
;
return
stack_push
(
ctx
,
&
v
);
}
static
HRESULT
interp_string
(
exec_ctx_t
*
ctx
)
...
...
@@ -143,6 +184,12 @@ HRESULT exec_script(script_ctx_t *ctx, function_t *func)
vbsop_t
op
;
HRESULT
hres
=
S_OK
;
exec
.
stack_size
=
16
;
exec
.
top
=
0
;
exec
.
stack
=
heap_alloc
(
exec
.
stack_size
*
sizeof
(
VARIANT
));
if
(
!
exec
.
stack
)
return
E_OUTOFMEMORY
;
exec
.
code
=
func
->
code_ctx
;
exec
.
instr
=
exec
.
code
->
instrs
+
func
->
code_off
;
exec
.
script
=
ctx
;
...
...
@@ -152,11 +199,15 @@ HRESULT exec_script(script_ctx_t *ctx, function_t *func)
hres
=
op_funcs
[
op
](
&
exec
);
if
(
FAILED
(
hres
))
{
FIXME
(
"Failed %08x
\n
"
,
hres
);
stack_popn
(
&
exec
,
exec
.
top
);
break
;
}
exec
.
instr
+=
op_move
[
op
];
}
assert
(
!
exec
.
top
);
heap_free
(
exec
.
stack
);
return
hres
;
}
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