mirror of
https://github.com/nim-lang/Nim.git
synced 2026-06-10 05:38:10 +00:00
@@ -399,6 +399,7 @@ proc allRoots(n: PNode; result: var seq[PSym]; followDotExpr = true) =
|
||||
proc destMightOwn(c: var Partitions; dest: var VarIndex; n: PNode) =
|
||||
## Analyse if 'n' is an expression that owns the data, if so mark 'dest'
|
||||
## with 'ownsData'.
|
||||
if n.typ == nil: return
|
||||
case n.kind
|
||||
of nkEmpty, nkCharLit..nkNilLit:
|
||||
# primitive literals including the empty are harmless:
|
||||
|
||||
16
tests/arc/t15909.nim
Normal file
16
tests/arc/t15909.nim
Normal file
@@ -0,0 +1,16 @@
|
||||
discard """
|
||||
action: run
|
||||
cmd: "nim c --gc:arc $file"
|
||||
"""
|
||||
|
||||
proc f1() {.noreturn.} = raise newException(CatchableError, "")
|
||||
|
||||
proc f2(y: int): int =
|
||||
if y != 0:
|
||||
y
|
||||
else:
|
||||
f1()
|
||||
|
||||
doAssert f2(5) == 5
|
||||
doAssertRaises(CatchableError):
|
||||
discard f2(0)
|
||||
Reference in New Issue
Block a user