odin-lang / Odin

Odin Programming Language
https://odin-lang.org
BSD 3-Clause "New" or "Revised" License
7.05k stars 631 forks source link

Compiler panic using slice.sort on wasm32 #2698

Closed stan680 closed 8 months ago

stan680 commented 1 year ago

Context

    Odin: dev-2023-08:4a71603a
    OS:   Windows 10 Home Basic (version: 22H2), build 19045.3208
    CPU:  Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz
    RAM:  16283 MiB

Expected Behavior

Compiler should not panic when using slice.sort on wasm32 target

Current Behavior

Compiler panics when using slice.sort on wasm32 target

Failure Information (for bugs)

Steps to Reproduce

Compiling this with odin build main.odin -file -target=js_wasm32 (or freestanding_wasm32) should work

package main
import "core:slice"

main :: proc() {
    array :[5]int
    slice.sort(array[:])
}

Failure Logs

A:\projects\Odin\src\llvm_backend_general.cpp(2886): Panic: 
    Error in: A:/projects/Odin/core/slice/sort_private.odin(15:66), missing value 'call'
Kelimion commented 1 year ago

Confirmed. It's peculiar.