Odin
Odin copied to clipboard
Illegal instruction during compilation. Array element equals array in condition.
trafficstars
Context
Please provide any relevant information about your setup. This is important in case the issue is not reproducible except for under certain conditions.
Odin: dev-2022-08:a83ca212
OS: Manjaro Linux, Linux 5.10.136-1-MANJARO
CPU: AMD Ryzen Threadripper 1950X 16-Core Processor
RAM: 31996 MiB
Expected Behavior
The program to not compile and give a compilation error.
Current Behavior
The compiler crashes.
Failure Information (for bugs)
See failure logs.
Steps to Reproduce
Create a new file main.odin in an empty directory. Add the following code to it:
package main
import fmt "core:fmt"
main :: proc() {
a := [3]int{9, 4, 3}
if a[0] == ([3]int{1, 2, 3}) {
fmt.println("foo")
}
}
Execute odin build . in the directory to attempt to build it.
Failure Logs
odin build . output:
main.main
lb_emit_conv: src -> dst
Not Identical [3]int != int
Not Identical [3]int != int
Not Identical 7f434797a4f0 != 55706d7508f0
Not Identical 7f434797a4f0 != 55706d7508f0
src/llvm_backend_expr.cpp(2197): Panic: Invalid type conversion: '[3]int' to 'int' for procedure 'main.main'
Illegal instruction (core dumped)