authorgravatar for techatrix@mailbox.orgTechatrix <techatrix@mailbox.org> 2025-01-25 19:32:33+01:00
committergravatar for techatrix@mailbox.orgTechatrix <techatrix@mailbox.org> 2025-03-07 22:20:35+01:00
logde9c889a0e7b8ef71d1c1d11985bf87e180885a6
tree75108ce2fa42f8a9df7b7df4fd8918e6395bee7e
parente6596cbbf077e00190af5dfb418dd9c30ebe9b6f
signaturebadge-check Signed by SSH key SHA256:HYC3SjXQcAt6uwv9pu/6OoVQ2rUH8rb5zKiUHSe9uxk

aro_translate_c: fix ast lowering of continue node

fixes #22601

2 files changed, 15 insertions(+), 1 deletions(-)

lib/compiler/aro_translate_c/ast.zig+1-1
...@@ -993,7 +993,7 @@ fn renderNode(c: *Context, node: Node) Allocator.Error!NodeIndex {...@@ -993,7 +993,7 @@ fn renderNode(c: *Context, node: Node) Allocator.Error!NodeIndex {
993 .main_token = try c.addToken(.keyword_continue, "continue"),993 .main_token = try c.addToken(.keyword_continue, "continue"),
994 .data = .{994 .data = .{
995 .lhs = 0,995 .lhs = 0,
996 .rhs = undefined,996 .rhs = 0,
997 },997 },
998 }),998 }),
999 .return_void => return c.addNode(.{999 .return_void => return c.addNode(.{
test/cases/translate_c/continue_from_while.c created+14
...@@ -0,0 +1,14 @@
1void foo() {
2 for (;;) {
3 continue;
4 }
5}
6
7// translate-c
8// c_frontend=clang
9//
10// pub export fn foo() void {
11// while (true) {
12// continue;
13// }
14// }