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
cd191894
Commit
cd191894
authored
Jan 27, 2020
by
Jacek Caban
Committed by
Alexandre Julliard
Jan 27, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vbscript: Overflow hex literals in 16-bit range.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
05a5e606
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
5 deletions
+8
-5
global.c
dlls/vbscript/global.c
+3
-3
lex.c
dlls/vbscript/lex.c
+2
-2
lang.vbs
dlls/vbscript/tests/lang.vbs
+3
-0
No files found.
dlls/vbscript/global.c
View file @
cd191894
...
...
@@ -2793,7 +2793,7 @@ static const builtin_prop_t global_props[] = {
{
L"vbFormFeed"
,
NULL
,
BP_GET
,
VT_BSTR
,
(
UINT_PTR
)
&
vbFormFeed
},
{
L"vbFriday"
,
NULL
,
BP_GET
,
VT_I2
,
6
},
{
L"vbGeneralDate"
,
NULL
,
BP_GET
,
VT_I2
,
0
},
{
L"vbGreen"
,
NULL
,
BP_GET
,
VT_I4
,
0x00ff00
},
{
L"vbGreen"
,
NULL
,
BP_GET
,
VT_I4
,
(
INT16
)
0x00ff00
},
{
L"vbIgnore"
,
NULL
,
BP_GET
,
VT_I2
,
IDIGNORE
},
{
L"vbInformation"
,
NULL
,
BP_GET
,
VT_I2
,
MB_ICONASTERISK
},
{
L"vbInteger"
,
NULL
,
BP_GET
,
VT_I2
,
VT_I2
},
...
...
@@ -2840,7 +2840,7 @@ static const builtin_prop_t global_props[] = {
{
L"vbVerticalTab"
,
NULL
,
BP_GET
,
VT_BSTR
,
(
UINT_PTR
)
&
vbVerticalTab
},
{
L"vbWednesday"
,
NULL
,
BP_GET
,
VT_I2
,
4
},
{
L"vbWhite"
,
NULL
,
BP_GET
,
VT_I4
,
0xffffff
},
{
L"vbYellow"
,
NULL
,
BP_GET
,
VT_I4
,
0x00ffff
},
{
L"vbYellow"
,
NULL
,
BP_GET
,
VT_I4
,
(
INT16
)
0x00ffff
},
{
L"vbYes"
,
NULL
,
BP_GET
,
VT_I2
,
IDYES
},
{
L"vbYesNo"
,
NULL
,
BP_GET
,
VT_I2
,
MB_YESNO
},
{
L"vbYesNoCancel"
,
NULL
,
BP_GET
,
VT_I2
,
MB_YESNOCANCEL
},
...
...
@@ -2945,7 +2945,7 @@ static HRESULT Err_Raise(BuiltinDisp *This, VARIANT *args, unsigned args_cnt, VA
if
(
SUCCEEDED
(
hres
))
{
script_ctx_t
*
ctx
=
This
->
ctx
;
error
=
(
code
&
~
0xffff
)
?
map_hres
(
code
)
:
MAKE_VBSERROR
(
code
);
error
=
(
code
==
(
INT16
)
code
)
?
MAKE_VBSERROR
((
UINT16
)
code
)
:
map_hres
(
code
);
if
(
source
)
{
SysFreeString
(
ctx
->
ei
.
bstrSource
);
...
...
dlls/vbscript/lex.c
View file @
cd191894
...
...
@@ -310,7 +310,7 @@ static int hex_to_int(WCHAR c)
static
int
parse_hex_literal
(
parser_ctx_t
*
ctx
,
LONG
*
ret
)
{
const
WCHAR
*
begin
=
ctx
->
ptr
;
LONG
l
=
0
,
d
;
unsigned
l
=
0
,
d
;
while
((
d
=
hex_to_int
(
*++
ctx
->
ptr
))
!=
-
1
)
l
=
l
*
16
+
d
;
...
...
@@ -323,7 +323,7 @@ static int parse_hex_literal(parser_ctx_t *ctx, LONG *ret)
if
(
*
ctx
->
ptr
==
'&'
)
ctx
->
ptr
++
;
*
ret
=
l
;
*
ret
=
l
==
(
UINT16
)
l
?
(
INT16
)
l
:
l
;
return
tInt
;
}
...
...
dlls/vbscript/tests/lang.vbs
View file @
cd191894
...
...
@@ -53,6 +53,8 @@ Call ok(true = -1, "! true = -1")
Call
ok
(
false
=
0
,
"false <> 0"
)
Call
ok
(
&
hff
=
255
,
"&hff <> 255"
)
Call
ok
(
&
Hff
=
255
,
"&Hff <> 255"
)
Call
ok
(
&
hffff
=
-
1
,
"&hffff <> -1"
)
Call
ok
(
&
hfffe
=
-
2
,
"&hfffe <> -2"
)
W
=
5
Call
ok
(
W
=
5
,
"W = "
&
W
&
" expected "
&
5
)
...
...
@@ -88,6 +90,7 @@ Call ok(getVT(&h10&) = "VT_I2", "getVT(&h10&) is not VT_I2")
Call
ok
(
getVT
(
&
h10000&
)
=
"VT_I4"
,
"getVT(&h10000&) is not VT_I4"
)
Call
ok
(
getVT
(
&
H10000
&
)
=
"VT_I4"
,
"getVT(&H10000&) is not VT_I4"
)
Call
ok
(
getVT
(
&
hffFFffFF&
)
=
"VT_I2"
,
"getVT(&hffFFffFF&) is not VT_I2"
)
Call
ok
(
getVT
(
&
hffFFffFE&
)
=
"VT_I2"
,
"getVT(&hffFFffFE &) is not VT_I2"
)
Call
ok
(
getVT
(
1
e2
)
=
"VT_R8"
,
"getVT(1e2) is not VT_R8"
)
Call
ok
(
getVT
(
1
e0
)
=
"VT_R8"
,
"getVT(1e0) is not VT_R8"
)
Call
ok
(
getVT
(
0.1
e2
)
=
"VT_R8"
,
"getVT(0.1e2) is not VT_R8"
)
...
...
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