mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-28 17:04:41 +00:00
fixes #22153 It's a problem for refc because you cannot index a nil string: i.e. `[""]` is `{((NimStringDesc*) NIM_NIL)}` which cannot be indexed
24 lines
588 B
Nim
24 lines
588 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
|
|
|
|
block: # bug #22153
|
|
discard allocCStringArray([""])
|
|
discard allocCStringArray(["1234"])
|
|
|
|
var s = "1245"
|
|
s.add "1"
|
|
discard allocCStringArray([s])
|