Odin icon indicating copy to clipboard operation
Odin copied to clipboard

Looping over a constant array of constant slices gives llvm build error

Open bg-thompson opened this issue 2 years ago • 0 comments

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

bg-thompson avatar Dec 18 '22 20:12 bg-thompson