Skip to content

Instantly share code, notes, and snippets.

@turbo

turbo/repro.nim Secret

Created February 20, 2023 18:56
Show Gist options
  • Save turbo/8d0101656d23e64078782233a7608154 to your computer and use it in GitHub Desktop.
Save turbo/8d0101656d23e64078782233a7608154 to your computer and use it in GitHub Desktop.
# these are abitrary, but in real code AX >> AY
const V_AX* = 10_000
const V_AY* = 1_234
const V_B = (sizeof(BiggestUInt) * 8)
const V_C = V_AX div V_B + 1
type
V_D* = array[V_C, BiggestUInt]
V_E*[I: static int] = array[I, float32]
V_F*[N, I: static int] = array[N, V_E[I]]
echo "This works:"
var foo: V_F[V_AX, V_AY]
proc p() =
var bar: V_F[V_AX, V_AY]
echo "This segfaults at runtime:"
p()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment