yomm2 icon indicating copy to clipboard operation
yomm2 copied to clipboard

fix potential class/struct odr violations, and fix 32-bit shift

Open iboB opened this issue 3 months ago • 0 comments

Two commits in this PR:

  • Fix potential ODR violations from the same types declared as class or struct. While it's true that the Itanium ABI, does not distinguish between the two, other ABI-s might, and MSVC's does. In rare cases this may lead to crazy bugs.
  • Fix a 32-bit shift: 1 << M is a 32-bit shift. So, even though M and buckets will be 64-bit (size_t) on a x64 system, when M is 32 or more, UB will ensue.

iboB avatar Sep 02 '25 06:09 iboB