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
4fde6d41
Commit
4fde6d41
authored
Apr 11, 2018
by
Jacek Caban
Committed by
Alexandre Julliard
Apr 11, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: Properly parse large hexadecimal listerals.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
f96aa1f3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
4 deletions
+7
-4
lex.c
dlls/jscript/lex.c
+4
-4
lang.js
dlls/jscript/tests/lang.js
+3
-0
No files found.
dlls/jscript/lex.c
View file @
4fde6d41
...
...
@@ -487,18 +487,18 @@ static BOOL parse_numeric_literal(parser_ctx_t *ctx, double *ret)
HRESULT
hres
;
if
(
*
ctx
->
ptr
==
'0'
)
{
LONG
d
,
l
=
0
;
ctx
->
ptr
++
;
if
(
*
ctx
->
ptr
==
'x'
||
*
ctx
->
ptr
==
'X'
)
{
double
r
=
0
;
int
d
;
if
(
++
ctx
->
ptr
==
ctx
->
end
)
{
ERR
(
"unexpected end of file
\n
"
);
return
FALSE
;
}
while
(
ctx
->
ptr
<
ctx
->
end
&&
(
d
=
hex_to_int
(
*
ctx
->
ptr
))
!=
-
1
)
{
l
=
l
*
16
+
d
;
r
=
r
*
16
+
d
;
ctx
->
ptr
++
;
}
...
...
@@ -508,7 +508,7 @@ static BOOL parse_numeric_literal(parser_ctx_t *ctx, double *ret)
return
FALSE
;
}
*
ret
=
l
;
*
ret
=
r
;
return
TRUE
;
}
...
...
dlls/jscript/tests/lang.js
View file @
4fde6d41
...
...
@@ -48,6 +48,9 @@ tmp = 07777777777777777777777;
ok
(
typeof
(
tmp
)
===
"number"
&&
tmp
>
0xffffffff
,
"tmp = "
+
tmp
);
tmp
=
07777777779777777777777
;
ok
(
typeof
(
tmp
)
===
"number"
&&
tmp
>
0xffffffff
,
"tmp = "
+
tmp
);
ok
(
0xffffffff
===
4294967295
,
"0xffffffff = "
+
0xffffffff
);
tmp
=
0x10000000000000000000000000000000000000000000000000000000000000000
;
ok
(
tmp
===
Math
.
pow
(
2
,
256
),
"0x1000...00 != 2^256"
);
ok
(
1
!==
2
,
"1 !== 2 is false"
);
ok
(
null
!==
undefined
,
"null !== undefined is false"
);
...
...
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