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
167174d8
Commit
167174d8
authored
Sep 10, 2012
by
Jacek Caban
Committed by
Alexandre Julliard
Sep 10, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vbscript: Added support for comparing to null.
parent
a4869de7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
10 deletions
+33
-10
interp.c
dlls/vbscript/interp.c
+20
-10
lang.vbs
dlls/vbscript/tests/lang.vbs
+13
-0
No files found.
dlls/vbscript/interp.c
View file @
167174d8
...
...
@@ -279,6 +279,13 @@ static HRESULT stack_push(exec_ctx_t *ctx, VARIANT *v)
return
S_OK
;
}
static
inline
HRESULT
stack_push_null
(
exec_ctx_t
*
ctx
)
{
VARIANT
v
;
V_VT
(
&
v
)
=
VT_NULL
;
return
stack_push
(
ctx
,
&
v
);
}
static
void
stack_popn
(
exec_ctx_t
*
ctx
,
unsigned
n
)
{
while
(
n
--
)
...
...
@@ -1143,12 +1150,8 @@ static HRESULT interp_empty(exec_ctx_t *ctx)
static
HRESULT
interp_null
(
exec_ctx_t
*
ctx
)
{
VARIANT
v
;
TRACE
(
"
\n
"
);
V_VT
(
&
v
)
=
VT_NULL
;
return
stack_push
(
ctx
,
&
v
);
return
stack_push_null
(
ctx
);
}
static
HRESULT
interp_nothing
(
exec_ctx_t
*
ctx
)
...
...
@@ -1306,11 +1309,6 @@ static HRESULT var_cmp(exec_ctx_t *ctx, VARIANT *l, VARIANT *r)
{
TRACE
(
"%s %s
\n
"
,
debugstr_variant
(
l
),
debugstr_variant
(
r
));
if
(
V_VT
(
l
)
==
VT_NULL
||
V_VT
(
r
)
==
VT_NULL
)
{
FIXME
(
"comparing nulls is not implemented
\n
"
);
return
E_NOTIMPL
;
}
/* FIXME: Fix comparing string to number */
return
VarCmp
(
l
,
r
,
ctx
->
script
->
lcid
,
0
);
...
...
@@ -1345,6 +1343,8 @@ static HRESULT interp_equal(exec_ctx_t *ctx)
hres
=
cmp_oper
(
ctx
);
if
(
FAILED
(
hres
))
return
hres
;
if
(
hres
==
VARCMP_NULL
)
return
stack_push_null
(
ctx
);
V_VT
(
&
v
)
=
VT_BOOL
;
V_BOOL
(
&
v
)
=
hres
==
VARCMP_EQ
?
VARIANT_TRUE
:
VARIANT_FALSE
;
...
...
@@ -1361,6 +1361,8 @@ static HRESULT interp_nequal(exec_ctx_t *ctx)
hres
=
cmp_oper
(
ctx
);
if
(
FAILED
(
hres
))
return
hres
;
if
(
hres
==
VARCMP_NULL
)
return
stack_push_null
(
ctx
);
V_VT
(
&
v
)
=
VT_BOOL
;
V_BOOL
(
&
v
)
=
hres
!=
VARCMP_EQ
?
VARIANT_TRUE
:
VARIANT_FALSE
;
...
...
@@ -1377,6 +1379,8 @@ static HRESULT interp_gt(exec_ctx_t *ctx)
hres
=
cmp_oper
(
ctx
);
if
(
FAILED
(
hres
))
return
hres
;
if
(
hres
==
VARCMP_NULL
)
return
stack_push_null
(
ctx
);
V_VT
(
&
v
)
=
VT_BOOL
;
V_BOOL
(
&
v
)
=
hres
==
VARCMP_GT
?
VARIANT_TRUE
:
VARIANT_FALSE
;
...
...
@@ -1393,6 +1397,8 @@ static HRESULT interp_gteq(exec_ctx_t *ctx)
hres
=
cmp_oper
(
ctx
);
if
(
FAILED
(
hres
))
return
hres
;
if
(
hres
==
VARCMP_NULL
)
return
stack_push_null
(
ctx
);
V_VT
(
&
v
)
=
VT_BOOL
;
V_BOOL
(
&
v
)
=
hres
==
VARCMP_GT
||
hres
==
VARCMP_EQ
?
VARIANT_TRUE
:
VARIANT_FALSE
;
...
...
@@ -1409,6 +1415,8 @@ static HRESULT interp_lt(exec_ctx_t *ctx)
hres
=
cmp_oper
(
ctx
);
if
(
FAILED
(
hres
))
return
hres
;
if
(
hres
==
VARCMP_NULL
)
return
stack_push_null
(
ctx
);
V_VT
(
&
v
)
=
VT_BOOL
;
V_BOOL
(
&
v
)
=
hres
==
VARCMP_LT
?
VARIANT_TRUE
:
VARIANT_FALSE
;
...
...
@@ -1425,6 +1433,8 @@ static HRESULT interp_lteq(exec_ctx_t *ctx)
hres
=
cmp_oper
(
ctx
);
if
(
FAILED
(
hres
))
return
hres
;
if
(
hres
==
VARCMP_NULL
)
return
stack_push_null
(
ctx
);
V_VT
(
&
v
)
=
VT_BOOL
;
V_BOOL
(
&
v
)
=
hres
==
VARCMP_LT
||
hres
==
VARCMP_EQ
?
VARIANT_TRUE
:
VARIANT_FALSE
;
...
...
dlls/vbscript/tests/lang.vbs
View file @
167174d8
...
...
@@ -144,6 +144,19 @@ Call ok(1 = 1 < 0, "! 1 = 1 < 0")
Call
ok
(
1
<=
2
,
"! 1 <= 2"
)
Call
ok
(
2
<=
2
,
"! 2 <= 2"
)
Call
ok
(
isNull
(
0
=
null
),
"'(0 = null)' is not null"
)
Call
ok
(
isNull
(
null
=
1
),
"'(null = 1)' is not null"
)
Call
ok
(
isNull
(
0
>
null
),
"'(0 > null)' is not null"
)
Call
ok
(
isNull
(
null
>
1
),
"'(null > 1)' is not null"
)
Call
ok
(
isNull
(
0
<
null
),
"'(0 < null)' is not null"
)
Call
ok
(
isNull
(
null
<
1
),
"'(null < 1)' is not null"
)
Call
ok
(
isNull
(
0
<>
null
),
"'(0 <> null)' is not null"
)
Call
ok
(
isNull
(
null
<>
1
),
"'(null <> 1)' is not null"
)
Call
ok
(
isNull
(
0
>=
null
),
"'(0 >= null)' is not null"
)
Call
ok
(
isNull
(
null
>=
1
),
"'(null >= 1)' is not null"
)
Call
ok
(
isNull
(
0
<=
null
),
"'(0 <= null)' is not null"
)
Call
ok
(
isNull
(
null
<=
1
),
"'(null <= 1)' is not null"
)
x
=
3
Call
ok
(
2
+
2
=
4
,
"2+2 = "
&
(
2
+
2
))
Call
ok
(
false
+
6
+
true
=
5
,
"false + 6 + true <> 5"
)
...
...
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