summary refs log tree commit diff stats
path: root/compiler/cgendata.nim
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2014-02-25 01:06:35 +0100
committerAraq <rumpf_a@web.de>2014-02-25 01:06:35 +0100
commit10768904eb65da1899d0d48cc1a2f3547af3bef0 (patch)
tree79676143be1663cacdbb5a8790451fde4e7366bc /compiler/cgendata.nim
parentab72377ce64cf2b563ea90204925b793082971cb (diff)
parente6b0b7ecc9bb81d94eec19fbc4fc62e104f59253 (diff)
downloadNim-10768904eb65da1899d0d48cc1a2f3547af3bef0.tar.gz
Merge branch 'devel' of https://github.com/Araq/Nimrod into devel
Conflicts:
	lib/system/jssys.nim
Diffstat (limited to 'compiler/cgendata.nim')
-rw-r--r--compiler/cgendata.nim7
1 files changed, 5 insertions, 2 deletions
diff --git a/compiler/cgendata.nim b/compiler/cgendata.nim
index 71479abdd..0df7bb6dc 100644
--- a/compiler/cgendata.nim
+++ b/compiler/cgendata.nim
@@ -65,11 +65,13 @@ type
     prc*: PSym                # the Nimrod proc that this C proc belongs to
     beforeRetNeeded*: bool    # true iff 'BeforeRet' label for proc is needed
     threadVarAccessed*: bool  # true if the proc already accessed some threadvar
-    nestedTryStmts*: seq[PNode] # in how many nested try statements we are
-                                # (the vars must be volatile then)
+    nestedTryStmts*: seq[PNode]   # in how many nested try statements we are
+                                  # (the vars must be volatile then)
     inExceptBlock*: int       # are we currently inside an except block?
                               # leaving such scopes by raise or by return must
                               # execute any applicable finally blocks
+    finallySafePoints*: seq[PRope]  # For correctly cleaning up exceptions when
+                                    # using return in finally statements
     labels*: Natural          # for generating unique labels in the C proc
     blocks*: seq[TBlock]      # nested blocks
     breakIdx*: int            # the block that will be exited
@@ -142,6 +144,7 @@ proc newProc*(prc: PSym, module: BModule): BProc =
   else: result.options = gOptions
   newSeq(result.blocks, 1)
   result.nestedTryStmts = @[]
+  result.finallySafePoints = @[]
 
 iterator cgenModules*: var BModule =
   for i in 0..high(gModules):