Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compiler crash on slice with too large of an element #4358

Open
MrMetube opened this issue Oct 8, 2024 · 0 comments
Open

Compiler crash on slice with too large of an element #4358

MrMetube opened this issue Oct 8, 2024 · 0 comments

Comments

@MrMetube
Copy link

MrMetube commented Oct 8, 2024

Context

Odin: dev-2024-10:d0eae4a9a
OS: Windows 11 Professional (version: 24H2), build 26100.1882
CPU: 12th Gen Intel(R) Core(TM) i5-12600
RAM: 32540 MiB
Backend: LLVM 18.1.8

The compiler correctly reports the size of "an array of a huge type" being an issue.
The compiler crashes when encountering "a slice of a huge type".

Error code: -1073741819

Reproduction

package main

main :: proc() {
    Huge :: [256][256]u32

    // For this case the compiler warns
    // Warning: Declaration of 'foo' may cause a stack overflow 
    // due to its type '[2][256][256]u32' having a size of 524288 bytes
    foo := [2]Huge{ Huge{}, Huge{} }

    // For this case the compiler just crashes
    bar := []Huge{ Huge{} }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants