summary refs log tree commit diff stats
path: root/compiler/cgen.nim
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2020-11-26 19:05:21 +0100
committerGitHub <noreply@github.com>2020-11-26 19:05:21 +0100
commitcf516713d070277d1455a20a14de705a1513c0d7 (patch)
treec9e6f78c3f4591e7de0d981fefc9d5161cf4e5a0 /compiler/cgen.nim
parent2f1a9eadd7023d6e6f837c8cb97b1cef8e599a61 (diff)
downloadNim-cf516713d070277d1455a20a14de705a1513c0d7.tar.gz
fixes https://github.com/status-im/nimbus-eth2/issues/1549 (#16146)
* fixes https://github.com/status-im/nimbus-eth2/issues/1549 [backport:1.4]

* test fixup
Diffstat (limited to 'compiler/cgen.nim')
-rw-r--r--compiler/cgen.nim8
1 files changed, 8 insertions, 0 deletions
diff --git a/compiler/cgen.nim b/compiler/cgen.nim
index c2a31b775..15b85097c 100644
--- a/compiler/cgen.nim
+++ b/compiler/cgen.nim
@@ -471,6 +471,14 @@ proc getTemp(p: BProc, t: PType, result: var TLoc; needsInit=false) =
   result.storage = OnStack
   result.flags = {}
   constructLoc(p, result, not needsInit)
+  when false:
+    # XXX Introduce a compiler switch in order to detect these easily.
+    if getSize(p.config, t) > 1024 * 1024:
+      if p.prc != nil:
+        echo "ENORMOUS TEMPORARY! ", p.config $ p.prc.info
+      else:
+        echo "ENORMOUS TEMPORARY! ", p.config $ p.lastLineInfo
+      writeStackTrace()
 
 proc getTempCpp(p: BProc, t: PType, result: var TLoc; value: Rope) =
   inc(p.labels)