fixes #13998 [backport:1.2]

(cherry picked from commit 82870e0737)
This commit is contained in:
Andreas Rumpf
2020-05-13 22:53:41 +02:00
committed by narimiran
parent 59a97a0e06
commit 32d56fa913

View File

@@ -981,7 +981,7 @@ proc genTryCpp(p: BProc, t: PNode, d: var TLoc) =
inc(p.labels, 2)
let etmp = p.labels
lineCg(p, cpsStmts, "std::exception_ptr T$1_ = nullptr;", [etmp])
p.procSec(cpsInit).add(ropecg(p.module, "\tstd::exception_ptr T$1_ = nullptr;", [etmp]))
let fin = if t[^1].kind == nkFinally: t[^1] else: nil
p.nestedTryStmts.add((fin, false, 0.Natural))