You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Operating System & Odin Version: Ubuntu 24.04, both dev-2025-02-nightly and 66540b7
Please paste odin report output:
Where to find more information and get into contact when you encounter a bug:
Website: https://odin-lang.org
GitHub: https://github.com/odin-lang/Odin/issues
Useful information to add to a bug report:
Odin: dev-2025-03:3ade69f
OS: Ubuntu 24.04.2 LTS, Linux 5.15.167.4-microsoft-standard-WSL2
CPU: 13th Gen Intel(R) Core(TM) i5-1334U
RAM: 5929 MiB
Backend: LLVM 18.1.3
Expected Behavior
Compiler error
Current Behavior
The compiler segfaults
Failure Information (for bugs)
From what I understood, the compiler cannot seem to determine the type of the global variable leading the entity.type to be a null pointer.
Removing the @(export) attribute compiles successfully and giving a type b: rawptr = &a fails with a linker a error.
Steps to Reproduce
package main
foreign {
@(link_name="b")
_b: rawptr
}
a := &_b
@(export)
b := &a
main :: proc() {
}
Compile the above program
Crash
Failure Logs
Backtrace
#0 0x0000555555648c0d in is_type_bit_set (t=0x0) at src/types.cpp:1737
#1 0x00005555556476e9 in signature_parameter_similar_enough (x=0x0, y=0x5555558e7470 <basic_types+4800>) at src/check_decl.cpp:701
#2 0x00005555556416f3 in check_global_variable_decl (ctx=0x7fffffffc880, e=@0x7fffffffc990: 0x7fffd67fe210, type_expr=0x0,
init_expr=0x7fffe6dd2b70) at src/check_decl.cpp:1491
#3 0x0000555555640ce4 in check_entity_decl (ctx=0x7fffe6fa00d0, e=0x7fffd67fe210, d=0x7fffd67fe3b0, named_type=0x0)
at src/check_decl.cpp:1695
#4 0x00005555556409e6 in check_single_global_entity (c=0x7fffe6dcfc20, e=0x7fffd67fe210, d=0x7fffd67fe3b0) at src/checker.cpp:4650
#5 0x0000555555611ae6 in check_all_global_entities (c=0x7fffe6dcfc20) at src/checker.cpp:4665
#6 0x000055555559c2ca in check_parsed_files (c=0x7fffe6dcfc20) at src/checker.cpp:6573
#7 0x00005555555854f2 in main (arg_count=4, arg_ptr=0x7fffffffe2d8) at src/main.cpp:3567
The text was updated successfully, but these errors were encountered:
Context
Ubuntu 24.04, both dev-2025-02-nightly and 66540b7
odin report
output:Expected Behavior
Compiler error
Current Behavior
The compiler segfaults
Failure Information (for bugs)
From what I understood, the compiler cannot seem to determine the type of the global variable leading the entity.type to be a null pointer.
Removing the
@(export)
attribute compiles successfully and giving a typeb: rawptr = &a
fails with a linker a error.Steps to Reproduce
Failure Logs
Backtrace
The text was updated successfully, but these errors were encountered: