summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2021-11-09 22:48:04 +0100
committerGitHub <noreply@github.com>2021-11-09 22:48:04 +0100
commit15157d06c3e0bba0c372a094917a13b916e15b54 (patch)
tree64096da3ddfc83f4354c829527bea3b5b2f1b8db
parent997ccc588955dab5cdbfd4c0fc067d91ccc1a7c8 (diff)
downloadNim-15157d06c3e0bba0c372a094917a13b916e15b54.tar.gz
fixes #14470 [backport:1.2] (#19115)
-rw-r--r--compiler/ccgtypes.nim3
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/ccgtypes.nim b/compiler/ccgtypes.nim
index 23e1a5867..e7e099659 100644
--- a/compiler/ccgtypes.nim
+++ b/compiler/ccgtypes.nim
@@ -220,7 +220,8 @@ proc isInvalidReturnType(conf: ConfigRef; rettype: PType): bool =
   # such a poor programming language.
   # We exclude records with refs too. This enhances efficiency and
   # is necessary for proper code generation of assignments.
-  if rettype == nil: result = true
+  if rettype == nil or getSize(conf, rettype) > conf.target.floatSize*3:
+    result = true
   else:
     case mapType(conf, rettype, skResult)
     of ctArray:
href='#n126'>126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172