astgen: fix int_type signedness and struct layout
Match Zig's Signedness enum values (unsigned=1, signed=0) and reorder int_type struct fields to match Zig's layout: [src_node, bit_count, signedness, pad]. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
3
astgen.c
3
astgen.c
@@ -2668,7 +2668,8 @@ static uint32_t tryResolvePrimitiveIdent(GenZir* gz, uint32_t node) {
|
||||
// Integer type detection: u29, i13, etc. (AstGen.zig:8304-8336).
|
||||
if (tok_len >= 2
|
||||
&& (source[tok_start] == 'u' || source[tok_start] == 'i')) {
|
||||
uint8_t signedness = (source[tok_start] == 'i') ? 1 : 0;
|
||||
// Zig Signedness enum: unsigned=1, signed=0
|
||||
uint8_t signedness = (source[tok_start] == 'u') ? 1 : 0;
|
||||
uint16_t bit_count = 0;
|
||||
bool valid = true;
|
||||
for (uint32_t k = tok_start + 1; k < tok_end; k++) {
|
||||
|
||||
@@ -798,8 +798,8 @@ test "astgen: corpus tokenizer_test.zig" {
|
||||
}
|
||||
|
||||
test "astgen: corpus parser_test.zig" {
|
||||
// TODO: int_type signedness data mismatch at inst[6899] — all tags and
|
||||
// inst_len match, but one int_type has ref=signed got=unsigned.
|
||||
// TODO: 10+ extra data mismatches (ref=48 got=32, bit 4 = propagate_error_trace)
|
||||
// in call instruction flags — ctx propagation differs from upstream.
|
||||
if (true) return error.SkipZigTest;
|
||||
const gpa = std.testing.allocator;
|
||||
try corpusCheck(gpa, @embedFile("parser_test.zig"));
|
||||
|
||||
Reference in New Issue
Block a user