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
bb9b2f33
Commit
bb9b2f33
authored
Jun 21, 2016
by
Jarkko Korpi
Committed by
Alexandre Julliard
Jun 23, 2016
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
widl: Fix overflow when left-shifting.
Signed-off-by:
Jarkko Korpi
<
jarkko_korpi@hotmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
d418ece9
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
expr.c
tools/widl/expr.c
+4
-4
No files found.
tools/widl/expr.c
View file @
bb9b2f33
...
...
@@ -222,8 +222,8 @@ expr_t *make_exprt(enum expr_type type, var_t *var, expr_t *expr)
e
->
is_const
=
TRUE
;
if
(
is_signed_integer_type
(
tref
))
{
cast_mask
=
(
1
<<
(
cast_type_bits
-
1
))
-
1
;
if
(
expr
->
cval
&
(
1
<<
(
cast_type_bits
-
1
)))
cast_mask
=
(
1
u
<<
(
cast_type_bits
-
1
))
-
1
;
if
(
expr
->
cval
&
(
1
u
<<
(
cast_type_bits
-
1
)))
e
->
cval
=
-
((
-
expr
->
cval
)
&
cast_mask
);
else
e
->
cval
=
expr
->
cval
&
cast_mask
;
...
...
@@ -231,8 +231,8 @@ expr_t *make_exprt(enum expr_type type, var_t *var, expr_t *expr)
else
{
/* calculate ((1 << cast_type_bits) - 1) avoiding overflow */
cast_mask
=
((
1
<<
(
cast_type_bits
-
1
))
-
1
)
|
1
<<
(
cast_type_bits
-
1
);
cast_mask
=
((
1
u
<<
(
cast_type_bits
-
1
))
-
1
)
|
1
u
<<
(
cast_type_bits
-
1
);
e
->
cval
=
expr
->
cval
&
cast_mask
;
}
}
...
...
Vitaly Lipatov
@lav
mentioned in commit
43493262
·
Sep 03, 2020
mentioned in commit
43493262
mentioned in commit 434932625cc595081e9b50041471779b326b9050
Toggle commit list
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