Skip to content

fix: Wrong usage of sizeof(this) in BitFlags::xfer(), W3DMPO::glueEnforcer()#1947

Merged
xezon merged 5 commits into
TheSuperHackers:mainfrom
bobtista:bobtista/build/clang-tidy-sizeof-fixes
Dec 7, 2025
Merged

fix: Wrong usage of sizeof(this) in BitFlags::xfer(), W3DMPO::glueEnforcer()#1947
xezon merged 5 commits into
TheSuperHackers:mainfrom
bobtista:bobtista/build/clang-tidy-sizeof-fixes

Conversation

@bobtista

@bobtista bobtista commented Dec 5, 2025

Copy link
Copy Markdown

1 Core/Libraries/Source/WWVegas/WWLib/always.h:147

  • Affects ~500+ classes using this macro for memory pool allocation.
  • Return value unused, and CI replays passed, so it seems safe.

2. BitFlags CRC Calculation (BitFlagsIO.h)

  • CRC calculation used sizeof(this), causing incomplete CRC hashing.
  • Behind retail compat flag

@Caball009

Caball009 commented Dec 5, 2025

Copy link
Copy Markdown

This function serves no run-time purpose, so it cannot should not affect the replays in any way :)

@bobtista bobtista changed the title bugfix: fix sizeof(this) in W3DMPO_GLUE macro bugfix: fix sizeof(this) bugs found by clang-tidy Dec 5, 2025
@bobtista bobtista self-assigned this Dec 5, 2025
@bobtista bobtista marked this pull request as ready for review December 5, 2025 18:33
Comment thread Generals/Code/GameEngine/Include/Common/BitFlagsIO.h Outdated
Comment thread GeneralsMD/Code/GameEngine/Include/Common/BitFlagsIO.h Outdated
Comment thread Core/Libraries/Source/WWVegas/WWLib/always.h Outdated
Comment thread Generals/Code/GameEngine/Include/Common/BitFlagsIO.h Outdated
@bobtista bobtista force-pushed the bobtista/build/clang-tidy-sizeof-fixes branch from 027fb74 to 0e6a476 Compare December 6, 2025 02:13
xezon
xezon previously approved these changes Dec 6, 2025

@xezon xezon left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks very good.

@xezon xezon requested a review from Skyaero42 December 6, 2025 11:34
@xezon xezon added Refactor Edits the code with insignificant behavior changes, is never user facing Fix Is fixing something, but is not user facing Gen Relates to Generals ZH Relates to Zero Hour Minor Severity: Minor < Major < Critical < Blocker labels Dec 6, 2025
Comment thread Generals/Code/GameEngine/Include/Common/BitFlagsIO.h Outdated
@xezon xezon dismissed their stale review December 6, 2025 11:41

Mistake

@xezon xezon changed the title bugfix: fix sizeof(this) bugs found by clang-tidy bugfix: Fix wrong usage of sizeof(this) in BitFlags::xfer(), W3DMPO::glueEnforcer() Dec 7, 2025
@xezon xezon changed the title bugfix: Fix wrong usage of sizeof(this) in BitFlags::xfer(), W3DMPO::glueEnforcer() fix: Wrong usage of sizeof(this) in BitFlags::xfer(), W3DMPO::glueEnforcer() Dec 7, 2025
@xezon xezon merged commit 2b1bcee into TheSuperHackers:main Dec 7, 2025
25 checks passed
fbraz3 pushed a commit to fbraz3/GeneralsX that referenced this pull request Feb 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Fix Is fixing something, but is not user facing Gen Relates to Generals Minor Severity: Minor < Major < Critical < Blocker Refactor Edits the code with insignificant behavior changes, is never user facing ZH Relates to Zero Hour

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants