summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorRuslan Mustakov <endragor@users.noreply.github.com>2017-05-12 03:30:48 +0700
committerAndreas Rumpf <rumpf_a@web.de>2017-05-11 22:30:48 +0200
commit29507d2491939d2979fbdfc4704142bc6ef2565c (patch)
treef42066e7d06075275511bc2958ff6eb2cc78c4e5
parent1a29069ececd4514195a58e1fe68385fa1240d46 (diff)
downloadNim-29507d2491939d2979fbdfc4704142bc6ef2565c.tar.gz
Consider optNoCppExceptions in blockLeaveActions (#5801)
-rw-r--r--compiler/ccgstmts.nim4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/ccgstmts.nim b/compiler/ccgstmts.nim
index cc925b150..a094da783 100644
--- a/compiler/ccgstmts.nim
+++ b/compiler/ccgstmts.nim
@@ -332,7 +332,7 @@ proc blockLeaveActions(p: BProc, howManyTrys, howManyExcepts: int) =
 
   var alreadyPoppedCnt = p.inExceptBlock
   for i in countup(1, howManyTrys):
-    if not p.module.compileToCpp:
+    if not p.module.compileToCpp or optNoCppExceptions in gGlobalOptions:
       # Pop safe points generated by try
       if alreadyPoppedCnt > 0:
         dec alreadyPoppedCnt
@@ -354,7 +354,7 @@ proc blockLeaveActions(p: BProc, howManyTrys, howManyExcepts: int) =
   for i in countdown(howManyTrys-1, 0):
     p.nestedTryStmts.add(stack[i])
 
-  if not p.module.compileToCpp:
+  if not p.module.compileToCpp or optNoCppExceptions in gGlobalOptions:
     # Pop exceptions that was handled by the
     # except-blocks we are in
     for i in countdown(howManyExcepts-1, 0):