Implements #9434. Minimal Stacktrace for Exceptions in release mode (#9480)

* Fixes #9434
This commit is contained in:
cooldome 2018-10-28 12:40:42 +00:00 • committed by Andreas Rumpf
commit dfb8730f51
4 changed files with 16 additions and 5 deletions

View file

@ -608,8 +608,10 @@ proc genRaiseStmt(p: BProc, t: PNode) =
if isImportedException(typ, p.config):
lineF(p, cpsStmts, "throw $1;$n", [e])
else:
lineCg(p, cpsStmts, "#raiseException((#Exception*)$1, $2);$n",
[e, makeCString(typ.sym.name.s)])
lineCg(p, cpsStmts, "#raiseExceptionEx((#Exception*)$1, $2, $3, $4, $5);$n",
[e, makeCString(typ.sym.name.s),
makeCString(if p.prc != nil: p.prc.name.s else: p.module.module.name.s),
makeCString(toFileName(p.config, t.info)), rope(toLinenumber(t.info))])
else:
genLineDir(p, t)
# reraise the last exception: