Skip to content
This repository was archived by the owner on Mar 4, 2026. It is now read-only.

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

Merged
jll63 merged 2 commits intojll63:masterfrom
iboB:fix-odr-and-shift
Feb 1, 2026
Merged

fix potential class/struct odr violations, and fix 32-bit shift#57
jll63 merged 2 commits intojll63:masterfrom
iboB:fix-odr-and-shift

Conversation

@iboB
Copy link
Copy Markdown
Contributor

@iboB iboB commented Sep 2, 2025

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 iboB requested a review from jll63 as a code owner September 2, 2025 06:21
@jll63
Copy link
Copy Markdown
Owner

jll63 commented Feb 1, 2026

Sorry I just noticed this. I was busy with transforming YOMM2 into Boost.OpenMethod. I am about to announce (on reddit) that I am retiring YOMM2 - but my work on open methods continue of course!

Thanks for the PR though. class vs struct is a Microsoft blunder. I did fall prey to strange bugs on MSVC. I'll check if the shift problem exists in OpenMethod. I am merging your PR and you will have the honor of submitting the last one.

Please consider moving on to Boost.OpenMethod!

@jll63 jll63 merged commit 18966d6 into jll63:master Feb 1, 2026
12 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants