summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2016-08-04 21:44:06 +0200
committerAndreas Rumpf <rumpf_a@web.de>2016-08-04 21:44:06 +0200
commit7ea318a05369a3b0847f7137a173df57b0ad0596 (patch)
tree08a661663936a00bcdf8528dd43dffa242f8cba0 /compiler
parent5d5636138377b63c4b7357ff40048b65a8dcd054 (diff)
downloadNim-7ea318a05369a3b0847f7137a173df57b0ad0596.tar.gz
fixes #4505, fixes #4230
Diffstat (limited to 'compiler')
-rw-r--r--compiler/cgen.nim3
-rw-r--r--compiler/cgendata.nim10
2 files changed, 7 insertions, 6 deletions
diff --git a/compiler/cgen.nim b/compiler/cgen.nim
index 4dbe8572e..9851ab0e2 100644
--- a/compiler/cgen.nim
+++ b/compiler/cgen.nim
@@ -328,7 +328,8 @@ proc initLocalVar(p: BProc, v: PSym, immediateAsgn: bool) =
 proc getTemp(p: BProc, t: PType, result: var TLoc; needsInit=false) =
   inc(p.labels)
   result.r = "LOC" & rope(p.labels)
-  linefmt(p, cpsLocals, "$1 $2;$n", getTypeDesc(p.module, t), result.r)
+  addf(p.blocks[0].sections[cpsLocals],
+     "$1 $2;$n", [getTypeDesc(p.module, t), result.r])
   result.k = locTemp
   #result.a = - 1
   result.t = t
diff --git a/compiler/cgendata.nim b/compiler/cgendata.nim
index c027bb451..a94950029 100644
--- a/compiler/cgendata.nim
+++ b/compiler/cgendata.nim
@@ -15,7 +15,7 @@ import
 from msgs import TLineInfo
 
 type
-  TLabel* = Rope             # for the C generator a label is just a rope
+  TLabel* = Rope              # for the C generator a label is just a rope
   TCFileSection* = enum       # the sections a generated C file consists of
     cfsMergeInfo,             # section containing merge information
     cfsHeaders,               # section for C include file headers
@@ -89,7 +89,7 @@ type
                               # requires 'T x = T()' to become 'T x; x = T()'
                               # (yes, C++ is weird like that)
     gcFrameId*: Natural       # for the GC stack marking
-    gcFrameType*: Rope       # the struct {} we put the GC markers into
+    gcFrameType*: Rope        # the struct {} we put the GC markers into
 
   TTypeSeq* = seq[PType]
 
@@ -111,10 +111,10 @@ type
     tmpBase*: Rope            # base for temp identifier generation
     typeCache*: TIdTable      # cache the generated types
     forwTypeCache*: TIdTable  # cache for forward declarations of types
-    declaredThings*: IntSet  # things we have declared in this .c file
-    declaredProtos*: IntSet  # prototypes we have declared in this .c file
+    declaredThings*: IntSet   # things we have declared in this .c file
+    declaredProtos*: IntSet   # prototypes we have declared in this .c file
     headerFiles*: TLinkedList # needed headers to include
-    typeInfoMarker*: IntSet  # needed for generating type information
+    typeInfoMarker*: IntSet   # needed for generating type information
     initProc*: BProc          # code for init procedure
     postInitProc*: BProc      # code to be executed after the init proc
     preInitProc*: BProc       # code executed before the init proc