Files
Nim/tests/objects/t20972.nim
ringabout 65a7496e51 fix #20972 fixes invalid and UB codegen case object transitions for both refc and ORC [backport] (#21611)
fix #20972 fixes invalid and UB codegen case object transitions for refc and ORC

(cherry picked from commit 3575f2bf9c)
2023-04-05 08:09:27 +02:00

16 lines
432 B
Nim

discard """
matrix: "--mm:refc -d:release; --mm:orc -d:release"
"""
{.passC: "-fsanitize=undefined -fsanitize-undefined-trap-on-error -Wall -Wextra -pedantic -flto".}
{.passL: "-fsanitize=undefined -fsanitize-undefined-trap-on-error -flto".}
# bug #20972
type ForkedEpochInfo = object
case kind: bool
of true, false: discard
var info = ForkedEpochInfo(kind: true)
doAssert info.kind
info.kind = false
doAssert not info.kind