don't emit an implicit try finally when in system.nim in order to prevent endless recursions in the try handler
This commit is contained in:
parent
0a01f5b655
commit
da6ff14184
1 changed files with 2 additions and 1 deletions
|
|
@ -995,7 +995,8 @@ proc genTry(p: BProc, t: PNode, d: var TLoc) =
|
||||||
#
|
#
|
||||||
if not isEmptyType(t.typ) and d.k == locNone:
|
if not isEmptyType(t.typ) and d.k == locNone:
|
||||||
getTemp(p, t.typ, d)
|
getTemp(p, t.typ, d)
|
||||||
let quirkyExceptions = isDefined(p.config, "nimQuirky")
|
let quirkyExceptions = isDefined(p.config, "nimQuirky") or
|
||||||
|
(t.kind == nkHiddenTryStmt and sfSystemModule in p.module.module.flags)
|
||||||
if not quirkyExceptions:
|
if not quirkyExceptions:
|
||||||
p.module.includeHeader("<setjmp.h>")
|
p.module.includeHeader("<setjmp.h>")
|
||||||
genLineDir(p, t)
|
genLineDir(p, t)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue