Merge pull request #3904 from endragor/fixnocppexceptions
Fixed try statement generation with --noCppExceptions switch
This commit is contained in:
commit
017969c146
1 changed files with 4 additions and 2 deletions
|
|
@ -928,8 +928,10 @@ proc genTry(p: BProc, t: PNode, d: var TLoc) =
|
||||||
for j in countup(0, blen - 2):
|
for j in countup(0, blen - 2):
|
||||||
assert(t.sons[i].sons[j].kind == nkType)
|
assert(t.sons[i].sons[j].kind == nkType)
|
||||||
if orExpr != nil: add(orExpr, "||")
|
if orExpr != nil: add(orExpr, "||")
|
||||||
appcg(p.module, orExpr,
|
let isObjFormat = if not p.module.compileToCpp:
|
||||||
"#isObj(#getCurrentException()->Sup.m_type, $1)",
|
"#isObj(#getCurrentException()->Sup.m_type, $1)"
|
||||||
|
else: "#isObj(#getCurrentException()->m_type, $1)"
|
||||||
|
appcg(p.module, orExpr, isObjFormat,
|
||||||
[genTypeInfo(p.module, t.sons[i].sons[j].typ)])
|
[genTypeInfo(p.module, t.sons[i].sons[j].typ)])
|
||||||
if i > 1: line(p, cpsStmts, "else ")
|
if i > 1: line(p, cpsStmts, "else ")
|
||||||
startBlock(p, "if ($1) {$n", [orExpr])
|
startBlock(p, "if ($1) {$n", [orExpr])
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue