mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-28 17:04:41 +00:00
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:
@@ -995,7 +995,8 @@ proc genTry(p: BProc, t: PNode, d: var TLoc) =
|
||||
#
|
||||
if not isEmptyType(t.typ) and d.k == locNone:
|
||||
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:
|
||||
p.module.includeHeader("<setjmp.h>")
|
||||
genLineDir(p, t)
|
||||
|
||||
Reference in New Issue
Block a user