Odin icon indicating copy to clipboard operation
Odin copied to clipboard

Assertion bug on overloaded procedure append within procedure body

Open Skytrias opened this issue 3 years ago • 1 comments

Context

Operating System & Odin Version:

  • Odin: dev-2022-02:cd89d8a3
  • OS: Linux Mint 20, Linux 5.4.0-89-generic
  • CPU: AMD Ryzen 5 3600 6-Core Processor
  • RAM: 15998 MiB

Expected Behavior

Use correct append_* call when using overloaded append

Current Behavior

Assertion bug triggers

Steps to Reproduce

package main

// some call with normal append
c :: proc()  {
    list: [dynamic]int
    append(&list, 0)
}

main :: proc() {
    a: [dynamic]int

    // has to happen somewhere, doesnt matter where, still crashes when happening afterwards
    c()
    
    // has to be procedure inside of a body
    b :: proc(a: ^[dynamic]int) {
        values: [dynamic]int
        append(a, ..values[:])    
        // append_elems(a, ..values[:]) // doesnt happen when explicit
    }
}

Failure Logs

src/llvm_backend_proc.cpp(64): Assertion Failure: `entity->flags & EntityFlag_ProcBodyChecked` append_elems :: proc(^[dynamic]int, ..int, Source_Code_Location)

Skytrias avatar Feb 18 '22 20:02 Skytrias

Hello!

I am marking this issue as stale as it has not received any engagement from the community or maintainers 120 days. That does not imply that the issue has no merit! If you feel strongly about this issue

  • open a PR referencing and resolving the issue;
  • leave a comment on it and discuss ideas how you could contribute towards resolving it;
  • leave a comment and describe in detail why this issue is critical for your use case;
  • open a new issue with updated details and a plan on resolving the issue.

The motivation for this automation is to help prioritize issues in the backlog and not ignore, reject, or belittle anyone..

github-actions[bot] avatar Jul 24 '22 22:07 github-actions[bot]