fix reraise (#11017)
This commit is contained in:
parent
e33266ded1
commit
fdc3f54f97
2 changed files with 9 additions and 5 deletions
|
|
@ -753,7 +753,7 @@ proc p(n: PNode; c: var Con): PNode =
|
||||||
result = copyTree(n)
|
result = copyTree(n)
|
||||||
result[1][0] = p(result[1][0], c)
|
result[1][0] = p(result[1][0], c)
|
||||||
of nkRaiseStmt:
|
of nkRaiseStmt:
|
||||||
if optNimV2 in c.graph.config.globalOptions:
|
if optNimV2 in c.graph.config.globalOptions and n[0].kind != nkEmpty:
|
||||||
let t = n[0].typ
|
let t = n[0].typ
|
||||||
let tmp = getTemp(c, t, n.info)
|
let tmp = getTemp(c, t, n.info)
|
||||||
var m = genCopyNoCheck(c, t, tmp, n[0])
|
var m = genCopyNoCheck(c, t, tmp, n[0])
|
||||||
|
|
|
||||||
|
|
@ -9,10 +9,14 @@ import system / ansi_c
|
||||||
import core / allocators
|
import core / allocators
|
||||||
|
|
||||||
proc mainA =
|
proc mainA =
|
||||||
|
try:
|
||||||
var e: owned(ref ValueError)
|
var e: owned(ref ValueError)
|
||||||
new(e)
|
new(e)
|
||||||
e.msg = "message"
|
e.msg = "message"
|
||||||
raise e
|
raise e
|
||||||
|
except Exception as e:
|
||||||
|
raise
|
||||||
|
|
||||||
|
|
||||||
proc main =
|
proc main =
|
||||||
raise newException(ValueError, "argh")
|
raise newException(ValueError, "argh")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue