Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change Word64 type from long long to unsigned long long
The following change is required to solve undefined behavior detected by UBSan. 405 EventFilter/ESRawToDigi/src/ESUnpacker.cc:17:22 405 EventFilter/ESRawToDigi/src/ESUnpacker.cc:18:22 405 EventFilter/ESRawToDigi/src/ESUnpacker.cc:19:22 405 EventFilter/ESRawToDigi/src/ESUnpacker.cc:20:22 405 EventFilter/ESRawToDigi/src/ESUnpacker.cc:21:22 405 EventFilter/ESRawToDigi/src/ESUnpacker.cc:22:22 405 EventFilter/ESRawToDigi/src/ESUnpacker.cc:23:22 405 EventFilter/ESRawToDigi/src/ESUnpacker.cc:24:22 405 EventFilter/ESRawToDigi/src/ESUnpacker.cc:25:22 ~Word64(0) is -1 and left shifting a negative number is undefined behavior by C++. These produce 3645 runtime errors from UBSan on full matrix. That's ~15% of all detected runtime errors. Word32 is defined as unsigned type. Keep it consistent and define Word64 as unsigned long long, thus resolved undefined behavior. Looking at the code these 64-bit masks are not used outside this package and they are only used with bitwise and operators. The change should not have any side effects. Signed-off-by: David Abdurachmanov <David.Abdurachmanov@cern.ch>
- Loading branch information