GenDataFooter conditional compilation complexity
GenDataFooter has conditional fields guarded by #ifdef ENABLE_LIGHTWEIGHT_FRAMES and #ifdef aarch64. This means sizeof(GenDataFooter) can vary between compilation units if preprocessor flags differ.
Current state
- sizeof(GenDataFooter) = 80 on aarch64 with ENABLE_LIGHTWEIGHT_FRAMES=1 (verified via GDB)
- static_assert(sizeof(GenDataFooter) == 80) added to gen_asm.cpp and generators_mm.cpp
- The static_asserts catch compile-time inconsistencies
Remaining risk
- The cmake build system should be audited to confirm all compilation units that use GenDataFooter receive identical preprocessor flags
- If sizeof differs between units, the allocator and consumer disagree on struct layout, causing silent memory corruption
- The static_asserts are a mitigation, not a root cause fix
Recommendation
Audit cmake targets for gen_asm.cpp, generators_mm.cpp, gen_data_footer.cpp, jit_rt.cpp, and generators_rt.cpp to verify identical preprocessor definitions.
GenDataFooter conditional compilation complexity
GenDataFooter has conditional fields guarded by #ifdef ENABLE_LIGHTWEIGHT_FRAMES and #ifdef aarch64. This means sizeof(GenDataFooter) can vary between compilation units if preprocessor flags differ.
Current state
Remaining risk
Recommendation
Audit cmake targets for gen_asm.cpp, generators_mm.cpp, gen_data_footer.cpp, jit_rt.cpp, and generators_rt.cpp to verify identical preprocessor definitions.