Skip to content

Commit 05eb459

Browse files
author
Maxim Egorushkin
committed
Fix clang build error.
1 parent 36344c7 commit 05eb459

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

include/atomic_queue/atomic_queue.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ template<int N_BITS>
6060
struct IndexBits {
6161
enum : unsigned {
6262
mask_elem_idx = ~(~0u << N_BITS),
63-
mask_cache_line_idx = mask_elem_idx << N_BITS,
6463
mask_hi = ~0u << (2 * N_BITS),
6564
count = N_BITS
6665
};
@@ -111,7 +110,7 @@ struct RemapBmi {
111110
// (index << (nn & 31)) would make Address sanitizer happy.
112111
unsigned new_cache_line_idx = index << nn; // This statement generates shlx r32,r32,r32 with BMI2, otherwise shl r32,cl.
113112

114-
return new_cache_elem_idx | (new_cache_line_idx & Bits::mask_cache_line_idx) | (index & Bits::mask_hi);
113+
return new_cache_elem_idx | (new_cache_line_idx & ~Bits::mask_hi) | (index & Bits::mask_hi);
115114
}
116115
};
117116
#endif

0 commit comments

Comments
 (0)