Odin
Odin copied to clipboard
Looping over a constant array of constant slices gives llvm build error
Context
Odin: dev-2022-12:ffe953b4
OS: Windows 11 Home Basic (version: 22H2), build 22621.963
CPU: Intel(R) Core(TM) i5-10400F CPU @ 2.90GHz
RAM: 32689 MiB
Failure Information (for bugs)
Attempting to compile the following code
package bug
import "core:fmt"
A :: struct{ a : []i8 }
B :: A{ {1,2} }
Ar :: [2]A {B,B}
main :: proc() {
for c in Ar { fmt.println(c) }
}
produces the following llvm error:
C:\Odin\src\llvm_backend_general.cpp(2689): Assertion Failure: `LLVMIsConstant(value.value)` = load [2 x bug.A], [2 x bug.A]* , align 8