mirror of
https://github.com/ziglang/zig.git
synced 2026-02-20 08:14:48 +00:00
translate-c: fix #5305
This commit is contained in:
parent
6be16eeae9
commit
770a1aa967
@ -6496,7 +6496,11 @@ fn parseCPostfixExpr(c: *Context, m: *MacroCtx, scope: *Scope, type_name: ?Node)
|
||||
node = try Tag.field_access.create(c.arena, .{ .lhs = deref, .field_name = m.slice() });
|
||||
},
|
||||
.LBracket => {
|
||||
const index = try macroBoolToInt(c, try parseCExpr(c, m, scope));
|
||||
const index_val = try macroBoolToInt(c, try parseCExpr(c, m, scope));
|
||||
const index = try Tag.int_cast.create(c.arena, .{
|
||||
.lhs = try Tag.type.create(c.arena, "usize"),
|
||||
.rhs = index_val,
|
||||
});
|
||||
node = try Tag.array_access.create(c.arena, .{ .lhs = node, .rhs = index });
|
||||
try m.skip(c, .RBracket);
|
||||
},
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user