diff options
author | Araq <rumpf_a@web.de> | 2019-04-09 11:22:23 +0200 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2019-04-09 11:22:23 +0200 |
commit | da6ff14184084465e04812da877507cd6196ca23 (patch) | |
tree | f36d0b3b97f4bcfae705e912d4ccc338351cc556 | |
parent | 0a01f5b655db57e9ec6484b1bd9080c251e5769a (diff) | |
download | Nim-da6ff14184084465e04812da877507cd6196ca23.tar.gz |
don't emit an implicit try finally when in system.nim in order to prevent endless recursions in the try handler
-rw-r--r-- | compiler/ccgstmts.nim | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/ccgstmts.nim b/compiler/ccgstmts.nim index 2b1cb404d..49acad509 100644 --- a/compiler/ccgstmts.nim +++ b/compiler/ccgstmts.nim @@ -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) |