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
The compiler crashes when casting an integer to an array backed bit_field if the integer is larger than the array's individual elements can hold.
Here is a minimal reproduction:
package main
import"core:fmt"
main :: proc() {
BitField :: bit_field [2]u8 {}
fmt.println(BitField(256))
}
The text was updated successfully, but these errors were encountered:
hitchh1k3r
changed the title
Large value constants of array backed bit_fields crash the compiler
Casting int to array backed bit_fields can crash the compiler
Jun 8, 2024
Context
I was trying to set constant values for a 24bit bit_field.
Odin: dev-2024-06:96c06185d
OS: Windows 10 Professional (version: 22H2), build 19045.4412
CPU: Intel(R) Core(TM) i7-4771 CPU @ 3.50GHz
RAM: 16311 MiB
Backend: LLVM 17.0.1
Expected Behavior
The compiler should not crash.
Current Behavior
The compiler crashes with something like:
Failure Information
The compiler crashes when casting an integer to an array backed bit_field if the integer is larger than the array's individual elements can hold.
Here is a minimal reproduction:
The text was updated successfully, but these errors were encountered: