summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
authorRuslan Mustakov <ruslan.mustakov@xored.com>2016-02-26 14:55:11 +0600
committerRuslan Mustakov <ruslan.mustakov@xored.com>2016-02-29 21:09:19 +0600
commit040d4864a4b012f5876b72e5b6c9a3921e1a0674 (patch)
tree51c06965092e1c1061728defc4e248e47436e9ba /compiler
parentef1d771cf2bb5f9db81ef771243d8ab5b12a6b78 (diff)
downloadNim-040d4864a4b012f5876b72e5b6c9a3921e1a0674.tar.gz
Fixed try statement generation with --noCppExceptions switch
Diffstat (limited to 'compiler')
-rw-r--r--compiler/ccgstmts.nim6
1 files changed, 4 insertions, 2 deletions
diff --git a/compiler/ccgstmts.nim b/compiler/ccgstmts.nim
index 529e59273..f2ceadcce 100644
--- a/compiler/ccgstmts.nim
+++ b/compiler/ccgstmts.nim
@@ -928,8 +928,10 @@ proc genTry(p: BProc, t: PNode, d: var TLoc) =
       for j in countup(0, blen - 2):
         assert(t.sons[i].sons[j].kind == nkType)
         if orExpr != nil: add(orExpr, "||")
-        appcg(p.module, orExpr,
-              "#isObj(#getCurrentException()->Sup.m_type, $1)",
+        let isObjFormat = if not p.module.compileToCpp:
+          "#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)])
       if i > 1: line(p, cpsStmts, "else ")
       startBlock(p, "if ($1) {$n", [orExpr])