fix an UBSAN failure in DistributedMutex
Summary: Fix an `invalid-shift-base` UndefinedBehaviorSanitizer failure. Previously all of the DistributedMutex-inl.h tests would fail with the following message on my system: runtime error: left shift of 94500093116194837 by 8 places cannot be represented in type 'long' It might be slightly nicer in the long run to change this code to use `std::chrono::duration<std::uint64_t, std::nano>` throughout rather than `std::chrono::nanoseconds`. Currently the `time()` function casts the `uint64_t` value returned by `folly::hardware_timestamp()` into a signed value. Reviewed By: yfeldblum, aary Differential Revision: D14180336 fbshipit-source-id: b199ae22d951162dc6f31d7f1c41a7d67cbcc935
Showing
Please register or sign in to comment