From 2b1e072ce78aef89d6f064b403462b1500acee79 Mon Sep 17 00:00:00 2001 From: Sergey Fedorov Date: Sun, 2 Aug 2026 13:37:16 +0000 Subject: [PATCH 01/25] trans: fix swapped size/align on the inserted enum tag entry `ents[0].align` got tag_size and `ents[0].size` got tag_align. The two are identical for every power-of-two integer tag on most targets, so this stayed invisible, but it is wrong wherever a tag's size and alignment differ - e.g. a repr(u64) enum with data on i686 (size 8, align 4). Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_0179wmF1vKBsFua4Wh36WFc5 --- src/trans/target.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/trans/target.cpp b/src/trans/target.cpp index 7522004c..dd185775 100644 --- a/src/trans/target.cpp +++ b/src/trans/target.cpp @@ -2033,8 +2033,8 @@ namespace { ::std::sort(ents.begin(), ents.end(), sortfn_struct_fields); // - Add tag ents.insert(ents.begin(), Ent()); - ents[0].align = tag_size; - ents[0].size = tag_align; + ents[0].align = tag_align; + ents[0].size = tag_size; ents[0].field = ents.size() - 1; ents[0].ty = tag_ty.clone(); -- 2.43.0