Fix UB in folly/experimental/Bits.h
Summary: Test output before the fix is applied: ``` folly/experimental/Bits.h:247:59: runtime error: signed integer overflow: -2147483648 - 1 cannot be represented in type 'int' #0 folly/experimental/Bits.h:247 folly::Bits<...>::set(int*, unsigned long, unsigned long, int) #1 folly/experimental/test/BitsTest.cpp:228 std::enable_if<...>::type (anonymous namespace)::testSet<...>(unsigned char*, unsigned long, unsigned long, int) #2 folly/experimental/test/BitsTest.cpp:263 Bits_Boundaries_Test::TestBody() #17 folly/experimental/test/BitsTest.cpp:381 main ``` Reviewed By: philippv Differential Revision: D5160789 fbshipit-source-id: 43f1926d58f1a5c019d4f8794d10a7a80a5c4749
Showing
Please register or sign in to comment