From 19225b71abc10ad3871a7b32b67dab9b9fb4e913 Mon Sep 17 00:00:00 2001 From: Araq Date: Wed, 10 Jul 2019 16:10:20 +0200 Subject: [PATCH] fixes #10901 (cherry picked from commit 78174857f830d8bfee4771f592d146693e405600) --- compiler/vmgen.nim | 2 ++ 1 file changed, 2 insertions(+) diff --git a/compiler/vmgen.nim b/compiler/vmgen.nim index 13f4458c2f..7a4d2ba880 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: