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
5b83abce
Commit
5b83abce
authored
May 02, 2012
by
Jacek Caban
Committed by
Alexandre Julliard
May 02, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: Properly test if double may be converted to int32.
parent
2217e42c
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
2 deletions
+15
-2
jscript.h
dlls/jscript/jscript.h
+14
-1
regexp.c
dlls/jscript/regexp.c
+1
-1
No files found.
dlls/jscript/jscript.h
View file @
5b83abce
...
...
@@ -405,6 +405,19 @@ static inline DOUBLE num_val(const VARIANT *v)
return
V_VT
(
v
)
==
VT_I4
?
V_I4
(
v
)
:
V_R8
(
v
);
}
#ifndef INT32_MIN
#define INT32_MIN (-2147483647-1)
#endif
#ifndef INT32_MAX
#define INT32_MAX (2147483647)
#endif
static
inline
BOOL
is_int32
(
double
d
)
{
return
INT32_MIN
<=
d
&&
d
<=
INT32_MAX
&&
(
double
)(
int
)
d
==
d
;
}
static
inline
void
num_set_int
(
VARIANT
*
v
,
INT
i
)
{
V_VT
(
v
)
=
VT_I4
;
...
...
@@ -413,7 +426,7 @@ static inline void num_set_int(VARIANT *v, INT i)
static
inline
void
num_set_val
(
VARIANT
*
v
,
DOUBLE
d
)
{
if
(
d
==
(
DOUBLE
)(
INT
)
d
)
{
if
(
is_int32
(
d
)
)
{
V_VT
(
v
)
=
VT_I4
;
V_I4
(
v
)
=
d
;
}
else
{
...
...
dlls/jscript/regexp.c
View file @
5b83abce
...
...
@@ -3531,7 +3531,7 @@ static INT index_from_var(script_ctx_t *ctx, VARIANT *v)
}
n
=
floor
(
n
);
return
(
double
)(
INT
)
n
==
n
?
n
:
0
;
return
is_int32
(
n
)
?
n
:
0
;
}
static
HRESULT
RegExp_lastIndex
(
script_ctx_t
*
ctx
,
vdisp_t
*
jsthis
,
WORD
flags
,
DISPPARAMS
*
dp
,
...
...
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