Odin icon indicating copy to clipboard operation
Odin copied to clipboard

LLVM backend assertion fails with global pointer struct literal with pointer to global inside

Open jack-jjm opened this issue 1 year ago • 0 comments
trafficstars

package test

import "core:fmt"

Data :: struct{ payload : ^int }

data := &Data{
    payload = &number
}

number : int

main :: proc()
{
    fmt.println(data.payload^)
}

This exits with

src/llvm_backend_general.cpp(3022): Assertion Failure: `LLVMIsConstant(value.value)`    = load est.Data, ptr , align 8
Illegal instruction (core dumped)

if run with odin run.

system info:

Odin:    dev-2024-10:af9ae4897
OS:      Ubuntu 22.04.5 LTS, Linux 6.8.0-45-generic
CPU:     Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz
RAM:     15733 MiB
Backend: LLVM 18.1.8

Similar to 1353, but I don't know if it's related.

jack-jjm avatar Oct 02 '24 14:10 jack-jjm