Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix undefined behaviour in volk_32u_reverse_32u #664

Merged
merged 1 commit into from
Oct 22, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions kernels/volk/volk_32u_reverse_32u.h
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ volk_32u_reverse_32u_lut(uint32_t* out, const uint32_t* in, unsigned int num_poi
uint32_t* out_ptr = out;
unsigned int number = 0;
for (; number < num_points; ++number) {
*out_ptr = (BitReverseTable256[*in_ptr & 0xff] << 24) |
*out_ptr = ((uint32_t)BitReverseTable256[*in_ptr & 0xff] << 24) |
(BitReverseTable256[(*in_ptr >> 8) & 0xff] << 16) |
(BitReverseTable256[(*in_ptr >> 16) & 0xff] << 8) |
(BitReverseTable256[(*in_ptr >> 24) & 0xff]);
Expand Down Expand Up @@ -354,7 +354,7 @@ volk_32u_reverse_32u_neonv8(uint32_t* out, const uint32_t* in, unsigned int num_
}
number = quarterPoints * 4;
for (; number < num_points; ++number) {
*out_ptr = (BitReverseTable256[*in_ptr & 0xff] << 24) |
*out_ptr = ((uint32_t)BitReverseTable256[*in_ptr & 0xff] << 24) |
(BitReverseTable256[(*in_ptr >> 8) & 0xff] << 16) |
(BitReverseTable256[(*in_ptr >> 16) & 0xff] << 8) |
(BitReverseTable256[(*in_ptr >> 24) & 0xff]);
Expand Down
Loading