Odin icon indicating copy to clipboard operation
Odin copied to clipboard

parapoly proc with non odin context fails when called directly

Open Skytrias opened this issue 2 years ago • 0 comments

Context

    Odin: dev-2023-11:f809788f
    OS:   Windows 10 Home Basic (version: 22H2), build 19045.3693
    CPU:  AMD Ryzen 5 3600 6-Core Processor
    RAM:  16310 MiB

Expected Behavior

Allow parapoly proc to be called when doing arrays.

Current Behavior

Crashes when using the parapoly proc itself instead of the original call?

Failure Information (for bugs)

C:\Users\skytr\Desktop\Odin\src\llvm_backend_proc.cpp(72): Panic: string2str8 :: proc "cdecl" (string) -> str8 (was parapoly: 0 0)

Steps to Reproduce

string2str8 :: proc "c" (str: string) -> str8 {
    return { raw_data(str), len(str) }
}

STR8 :: string2str8

// ...

// replacing the calls below with string2str8 works as expected
clockNumberStrings := [?]oc.str8 {
    oc.STR8("12"),
    oc.STR8("1"),
    oc.STR8("2"),
    oc.STR8("3"),
    oc.STR8("4"),
    oc.STR8("5"),
    oc.STR8("6"),
    oc.STR8("7"),
    oc.STR8("8"),
    oc.STR8("9"),
    oc.STR8("10"),
    oc.STR8("11"),
}

Skytrias avatar Nov 25 '23 22:11 Skytrias