summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2023-06-27 22:42:48 +0200
committerGitHub <noreply@github.com>2023-06-27 22:42:48 +0200
commit427ad17161a19ecf8d0e2fc932064e18226210fa (patch)
tree970b0bfa657ecada1c87c0fdc5a6869d4a1576c6 /compiler
parent9616762cfe7a6d1607ba7d00e00537e9620aff50 (diff)
downloadNim-427ad17161a19ecf8d0e2fc932064e18226210fa.tar.gz
fixes #22001 (#22177)
* fixes #22001

* added test case
Diffstat (limited to 'compiler')
-rw-r--r--compiler/dfa.nim6
1 files changed, 4 insertions, 2 deletions
diff --git a/compiler/dfa.nim b/compiler/dfa.nim
index d145e31c3..b21fcf473 100644
--- a/compiler/dfa.nim
+++ b/compiler/dfa.nim
@@ -264,7 +264,8 @@ proc genBreakOrRaiseAux(c: var Con, i: int, n: PNode) =
     c.blocks[i].raiseFixups.add lab1
   else:
     var trailingFinales: seq[PNode]
-    if c.inTryStmt > 0: #Ok, we are in a try, lets see which (if any) try's we break out from:
+    if c.inTryStmt > 0:
+      # Ok, we are in a try, lets see which (if any) try's we break out from:
       for b in countdown(c.blocks.high, i):
         if c.blocks[b].isTryBlock:
           trailingFinales.add c.blocks[b].finale
@@ -385,7 +386,8 @@ proc genCall(c: var Con; n: PNode) =
       # Pass by 'out' is a 'must def'. Good enough for a move optimizer.
       genDef(c, n[i])
   # every call can potentially raise:
-  if false: # c.inTryStmt > 0 and canRaiseConservative(n[0]):
+  if c.inTryStmt > 0 and canRaiseConservative(n[0]):
+    inc c.interestingInstructions
     # we generate the instruction sequence:
     # fork lab1
     # goto exceptionHandler (except or finally)