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
409bafcc
Commit
409bafcc
authored
Nov 07, 2017
by
Piotr Caban
Committed by
Alexandre Julliard
Nov 07, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
oleaut32: Ignore underflows in VarR8FromStr.
Signed-off-by:
Piotr Caban
<
piotr@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
61c18632
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
4 deletions
+10
-4
vartest.c
dlls/oleaut32/tests/vartest.c
+5
-0
vartype.c
dlls/oleaut32/tests/vartype.c
+1
-0
variant.c
dlls/oleaut32/variant.c
+4
-4
No files found.
dlls/oleaut32/tests/vartest.c
View file @
409bafcc
...
...
@@ -1947,6 +1947,11 @@ static void test_VarNumFromParseNum(void)
/* Currency is preferred over decimal */
SETRGB
(
0
,
1
);
CONVERT
(
1
,
0
,
0
,
1
,
0
,
0
,
VTBIT_CY
|
VTBIT_DECIMAL
);
EXPECT_CY
(
1
);
/* Underflow test */
SETRGB
(
0
,
1
);
CONVERT
(
1
,
0
,
NUMPRS_EXPONENT
,
1
,
0
,
-
94938484
,
VTBIT_R4
);
EXPECT_R4
(
0
.
0
);
SETRGB
(
0
,
1
);
CONVERT
(
1
,
0
,
NUMPRS_EXPONENT
,
1
,
0
,
-
94938484
,
VTBIT_R8
);
EXPECT_R8
(
0
.
0
);
SETRGB
(
0
,
1
);
CONVERT
(
1
,
0
,
NUMPRS_EXPONENT
,
1
,
0
,
-
94938484
,
VTBIT_CY
);
EXPECT_CY
(
0
);
}
...
...
dlls/oleaut32/tests/vartype.c
View file @
409bafcc
...
...
@@ -2729,6 +2729,7 @@ static void test_VarR8FromStr(void)
CONVERT_STR
(
VarR8FromStr
,
"0.5"
,
LOCALE_NOUSEROVERRIDE
);
EXPECT
(
0
.
5
);
CONVERT_STR
(
VarR8FromStr
,
"0.6"
,
LOCALE_NOUSEROVERRIDE
);
EXPECT
(
0
.
6
);
CONVERT_STR
(
VarR8FromStr
,
"1.5"
,
LOCALE_NOUSEROVERRIDE
);
EXPECT
(
1
.
5
);
CONVERT_STR
(
VarR8FromStr
,
"1e-94938484"
,
LOCALE_NOUSEROVERRIDE
);
EXPECT
(
0
);
/* We already have exhaustive tests for number parsing, so skip those tests here */
}
...
...
dlls/oleaut32/variant.c
View file @
409bafcc
...
...
@@ -2392,8 +2392,8 @@ HRESULT WINAPI VarNumFromParseNum(NUMPARSE *pNumprs, BYTE *rgbDig,
{
if
(
whole
<
dblMinimums
[
10
]
&&
whole
!=
0
)
{
dwVtBits
&=
~
(
VTBIT_R4
|
VTBIT_R8
|
VTBIT_CY
);
/* U
nderflow */
bOverflow
=
TRUE
;
whole
=
0
;
/* ignore u
nderflow */
divisor10
=
0
;
break
;
}
whole
=
whole
/
dblMultipliers
[
10
];
...
...
@@ -2403,8 +2403,8 @@ HRESULT WINAPI VarNumFromParseNum(NUMPARSE *pNumprs, BYTE *rgbDig,
{
if
(
whole
<
dblMinimums
[
divisor10
]
&&
whole
!=
0
)
{
dwVtBits
&=
~
(
VTBIT_R4
|
VTBIT_R8
|
VTBIT_CY
);
/* U
nderflow */
bOverflow
=
TRUE
;
whole
=
0
;
/* ignore u
nderflow */
divisor10
=
0
;
}
else
whole
=
whole
/
dblMultipliers
[
divisor10
];
...
...
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