summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2019-07-10 16:10:20 +0200
committerAraq <rumpf_a@web.de>2019-07-10 16:10:20 +0200
commit78174857f830d8bfee4771f592d146693e405600 (patch)
treeab1e6f952ae57bb09f273ca8b0f7dcd572bb056c /compiler
parentb03421d087bf671de456e008e87c435634a7708d (diff)
downloadNim-78174857f830d8bfee4771f592d146693e405600.tar.gz
fixes #10901
Diffstat (limited to 'compiler')
-rw-r--r--compiler/vmgen.nim2
1 files changed, 2 insertions, 0 deletions
diff --git a/compiler/vmgen.nim b/compiler/vmgen.nim
index fe9772d08..58517c2b8 100644
--- a/compiler/vmgen.nim
+++ b/compiler/vmgen.nim
@@ -559,6 +559,8 @@ proc genCall(c: PCtx; n: PNode; dest: var TDest) =
   #if n.typ != nil and n.typ.sym != nil and n.typ.sym.magic == mPNimrodNode:
   #  genLit(c, n, dest)
   #  return
+  # bug #10901: do not produce code for wrong call expressions:
+  if n.len == 0 or n[0].typ.isNil: return
   if dest < 0 and not isEmptyType(n.typ): dest = getTemp(c, n.typ)
   let x = c.getTempRange(n.len, slotTempUnknown)
   # varargs need 'opcSetType' for the FFI support: