Commit de9c889a0e

Techatrix <techatrix@mailbox.org>
2025-01-25 19:32:33
aro_translate_c: fix ast lowering of continue node
fixes #22601
1 parent e6596cb
Changed files (2)
lib
compiler
aro_translate_c
test
cases
lib/compiler/aro_translate_c/ast.zig
@@ -993,7 +993,7 @@ fn renderNode(c: *Context, node: Node) Allocator.Error!NodeIndex {
             .main_token = try c.addToken(.keyword_continue, "continue"),
             .data = .{
                 .lhs = 0,
-                .rhs = undefined,
+                .rhs = 0,
             },
         }),
         .return_void => return c.addNode(.{
test/cases/translate_c/continue_from_while.c
@@ -0,0 +1,14 @@
+void foo() {
+    for (;;) {
+        continue;
+    }
+}
+
+// translate-c
+// c_frontend=clang
+//
+// pub export fn foo() void {
+//     while (true) {
+//         continue;
+//     }
+// }