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
d090c394
Commit
d090c394
authored
May 23, 2012
by
Francois Gouget
Committed by
Alexandre Julliard
May 23, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vbscript: Add support for integer values in conditional jumps.
parent
f0d30968
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
18 deletions
+42
-18
interp.c
dlls/vbscript/interp.c
+34
-18
lang.vbs
dlls/vbscript/tests/lang.vbs
+8
-0
No files found.
dlls/vbscript/interp.c
View file @
d090c394
...
...
@@ -350,6 +350,34 @@ static inline void release_val(variant_val_t *v)
VariantClear
(
v
->
v
);
}
static
int
stack_pop_bool
(
exec_ctx_t
*
ctx
,
BOOL
*
b
)
{
variant_val_t
val
;
HRESULT
hres
;
hres
=
stack_pop_val
(
ctx
,
&
val
);
if
(
FAILED
(
hres
))
return
hres
;
switch
(
V_VT
(
val
.
v
))
{
case
VT_BOOL
:
*
b
=
V_BOOL
(
val
.
v
);
break
;
case
VT_I2
:
*
b
=
V_I2
(
val
.
v
);
break
;
case
VT_I4
:
*
b
=
V_I4
(
val
.
v
);
break
;
default:
FIXME
(
"unsupported for %s
\n
"
,
debugstr_variant
(
val
.
v
));
release_val
(
&
val
);
return
E_NOTIMPL
;
}
return
S_OK
;
}
static
HRESULT
stack_pop_disp
(
exec_ctx_t
*
ctx
,
IDispatch
**
ret
)
{
VARIANT
*
v
=
stack_pop
(
ctx
);
...
...
@@ -886,22 +914,16 @@ static HRESULT interp_jmp(exec_ctx_t *ctx)
static
HRESULT
interp_jmp_false
(
exec_ctx_t
*
ctx
)
{
const
unsigned
arg
=
ctx
->
instr
->
arg1
.
uint
;
variant_val_t
val
;
HRESULT
hres
;
BOOL
b
;
TRACE
(
"%u
\n
"
,
arg
);
hres
=
stack_pop_
val
(
ctx
,
&
val
);
hres
=
stack_pop_
bool
(
ctx
,
&
b
);
if
(
FAILED
(
hres
))
return
hres
;
if
(
V_VT
(
val
.
v
)
!=
VT_BOOL
)
{
FIXME
(
"unsupported for %s
\n
"
,
debugstr_variant
(
val
.
v
));
release_val
(
&
val
);
return
E_NOTIMPL
;
}
if
(
V_BOOL
(
val
.
v
))
if
(
b
)
ctx
->
instr
++
;
else
instr_jmp
(
ctx
,
ctx
->
instr
->
arg1
.
uint
);
...
...
@@ -911,22 +933,16 @@ static HRESULT interp_jmp_false(exec_ctx_t *ctx)
static
HRESULT
interp_jmp_true
(
exec_ctx_t
*
ctx
)
{
const
unsigned
arg
=
ctx
->
instr
->
arg1
.
uint
;
variant_val_t
val
;
HRESULT
hres
;
BOOL
b
;
TRACE
(
"%u
\n
"
,
arg
);
hres
=
stack_pop_
val
(
ctx
,
&
val
);
hres
=
stack_pop_
bool
(
ctx
,
&
b
);
if
(
FAILED
(
hres
))
return
hres
;
if
(
V_VT
(
val
.
v
)
!=
VT_BOOL
)
{
FIXME
(
"unsupported for %s
\n
"
,
debugstr_variant
(
val
.
v
));
release_val
(
&
val
);
return
E_NOTIMPL
;
}
if
(
V_BOOL
(
val
.
v
))
if
(
b
)
instr_jmp
(
ctx
,
ctx
->
instr
->
arg1
.
uint
);
else
ctx
->
instr
++
;
...
...
dlls/vbscript/tests/lang.vbs
View file @
d090c394
...
...
@@ -260,6 +260,14 @@ End If
Call
ok
(
x
,
"elseif not called?"
)
x
=
false
if
1
then
x
=
true
Call
ok
(
x
,
"if 1 not run?"
)
x
=
false
if
&
h10000&
then
x
=
true
Call
ok
(
x
,
"if &h10000& not run?"
)
x
=
false
y
=
false
while
not
(
x
and
y
)
if
x
then
...
...
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