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 assert failure when aliasing a package and using it in the file scope of another file #4034

Open
jv-guimaraes opened this issue Aug 8, 2024 · 0 comments
Assignees
Labels
frontend replicated We were able to replicate the bug.

Comments

@jv-guimaraes
Copy link

Context

    Odin:    dev-2024-08-nightly:6fe938b
    OS:      Windows 10 Unknown Edition (000000bf) (version: 21H2), build 19044.4651
    CPU:     AMD Ryzen 5 4600G with Radeon Graphics
    RAM:     15761 MiB
    Backend: LLVM 18.1.8

Expected Behavior

The compiler should display an appropriate error message instead of crashing.

Current Behavior

The compiler crashes with a null pointer assertion when compiling a program that uses a package alias defined in one file and referenced in another file's global scope.

package test

import "vendor:raylib"

rl :: raylib

main :: proc() {
}
package test

outside := rl.WHITE // this crashes

func :: proc() {
    inside := rl.WHITE // but this is fine
}

It with the following error:
D:\a\Odin\Odin\src\checker.cpp(4556): Assertion Failure: d != nullptr
The crash occurs most of the time, but occasionally the compilation succeeds. When compiled with -thread-count:1, it crashes 100% of the time.

@Kelimion Kelimion added frontend replicated We were able to replicate the bug. labels Aug 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
frontend replicated We were able to replicate the bug.
Projects
None yet
Development

No branches or pull requests

3 participants