Commit dca19fc4 authored by Anton Korobeynikov's avatar Anton Korobeynikov Committed by Jordan DeLong

Make sure the op does not change the sign of the operand

Summary: .

Test Plan: .

Reviewed By: soren@fb.com

FB internal diff: D660143

Blame Revision:
parent 8dd97c8c
......@@ -414,7 +414,8 @@ namespace detail {
}
template <class T>
T* pointerFlagClear(T* p) {
return reinterpret_cast<T*>(reinterpret_cast<uintptr_t>(p) & ~1);
return reinterpret_cast<T*>(
reinterpret_cast<uintptr_t>(p) & ~uintptr_t(1));
}
inline void* shiftPointer(void* p, size_t sizeBytes) {
return static_cast<char*>(p) + sizeBytes;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment