Loop return no conditional

This commit is contained in:
David Gonzalez Martin 2024-06-06 22:33:37 -06:00
parent 65ed3502c8
commit 6709fac566
3 changed files with 7 additions and 4 deletions

View File

@ -1,5 +1,3 @@
returns inside loops (else conditional)
returns inside loops (non-conditional)
function pointers
for loops
arrays

View File

@ -3991,8 +3991,6 @@ pub fn analyze_local_block(thread: *Thread, analyzer: *Analyzer, parser: *Parser
const loop_block = analyze_local_block(thread, analyzer, parser, file);
if (!loop_block.terminated) {
_ = emit_jump(analyzer, thread, loop_header_block);
} else {
unreachable;
}
},
else => unreachable,

View File

@ -0,0 +1,7 @@
fn[cc(.c)] main[export]() s32 {
>i: s32 = 0;
loop (i < 1) {
return 0;
}
return 1;
}