Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
853dee85
Commit
853dee85
authored
Oct 03, 2018
by
Eugene Kosov
Committed by
Sergey Vojtovich
Oct 16, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-17358 my_reverse_bits() is incorrect due to UB
my_reverse_bits(): add a cast to fix a bit shift
parent
bebe24b0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
include/my_bit.h
include/my_bit.h
+4
-4
No files found.
include/my_bit.h
View file @
853dee85
...
...
@@ -115,10 +115,10 @@ static inline uint32 my_clear_highest_bit(uint32 v)
static
inline
uint32
my_reverse_bits
(
uint32
key
)
{
return
(
_my_bits_reverse_table
[
key
&
255
]
<<
24
)
|
(
_my_bits_reverse_table
[(
key
>>
8
)
&
255
]
<<
16
)
|
(
_my_bits_reverse_table
[(
key
>>
16
)
&
255
]
<<
8
)
|
_my_bits_reverse_table
[(
key
>>
24
)
];
(
(
uint32
)
_my_bits_reverse_table
[
key
&
255
]
<<
24
)
|
(
(
uint32
)
_my_bits_reverse_table
[(
key
>>
8
)
&
255
]
<<
16
)
|
(
(
uint32
)
_my_bits_reverse_table
[(
key
>>
16
)
&
255
]
<<
8
)
|
(
uint32
)
_my_bits_reverse_table
[(
key
>>
24
)
];
}
C_MODE_END
...
...
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