Odin icon indicating copy to clipboard operation
Odin copied to clipboard

Compiler bug: No error about missing return statement when using `or_break` on a procedure

Open thetarnav opened this issue 9 months ago • 0 comments

A very similar issue to https://github.com/odin-lang/Odin/issues/3284, just this time it happens when doing or_break on a procedure with multiple values.

package main

condition :: proc() -> (int, bool) {
    return 0, false
}

foo :: proc() -> int {
	for {
		n := condition() or_break
		return n
	}
} // <- Should error about missing return statement

main :: proc() {
	foo() // Sometimes causes a segfault
}

odin report

	Odin:    dev-2024-04:fd582015f
	OS:      Ubuntu 22.04.4 LTS, Linux 6.5.0-28-generic
	CPU:     Intel(R) Core(TM) i5-8265U CPU @ 1.60GHz
	RAM:     7631 MiB
	Backend: LLVM 17.0.6

thetarnav avatar Apr 30 '24 22:04 thetarnav