fix implicit-integer-truncation UBSAN error in AtomicUtil-inl.h
Summary: UndefinedBehaviorSanitizer: implicit-integer-truncation buck-out/dev/gen/folly/synchronization/atomic_util#header-mode-symlink-tree-with-header-map,headers/folly/synchronization/AtomicUtil-inl.h:115:28 ``` Here both `mask` and the first argument in `std::atomic<..>::fetch_and` have type `unsigned char`. Before bitwise not operation `mask` variable undergoes [integral promotion](https://en.cppreference.com/w/cpp/language/implicit_conversion#Integral_promotion) resulting in truncation error. Since here this is intentional add a `static_cast` to be explicit about it. Reviewed By: yfeldblum Differential Revision: D19320340 fbshipit-source-id: 41c987c19b77fa21ee9aa83cf06dfc7cddba91c8
Showing
Please register or sign in to comment