这是indexloc提供的服务,不要输入任何密码
Skip to content

Compiler crash when compiling a specific proc for js_wasm32 #5483

@sergeypdev

Description

@sergeypdev

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-2025-07:2fc8ca6cf
OS: Fedora Linux 41 (Workstation Edition), Linux 6.15.4-100.fc41.x86_64
CPU: AMD Ryzen 5 7600 6-Core Processor
RAM: 63444 MiB
Backend: LLVM 19.1.7

Expected Behavior

No compiler crash

Current Behavior

Compiler crash

Failure Information (for bugs)

Checked with a debugger and it happens in some "tuple fix" code at llvm_backend_proc.cpp:1208. If I make the first arg to failing_proc a pointer instead it doesn't crash.

Steps to Reproduce

Please provide detailed steps for reproducing the issue.

  1.  package main
    
     import "core:fmt"
     
     My_Struct :: struct {}
     Other_Struct :: struct {
     	some: int,
     	data: string,
     }
     
     failing_proc :: proc(arg: My_Struct) -> (Other_Struct, bool) {
     	return {}, false
     }
     
     main :: proc() {
     	for _ in failing_proc(My_Struct{}) {
     		fmt.printf("blah")
     	}
     }
  2. odin build -target=js_wasm32
  3. Compiler crash

Failure Logs

src/array.cpp(13): Assertion Failure: `cast(usize)index < cast(usize)count` Index 1 is out of bounds ranges 0..<1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions