Return nil from genOtherArg after error.

This commit is contained in:
Matthew Baulch 2016-07-05 23:16:57 +10:00
commit a2301f64cd

View file

@ -262,6 +262,8 @@ proc genOtherArg(p: BProc; ri: PNode; i: int; typ: PType): Rope =
else: else:
if tfVarargs notin typ.flags: if tfVarargs notin typ.flags:
localError(ri.info, "wrong argument count") localError(ri.info, "wrong argument count")
result = nil
else:
result = genArgNoParam(p, ri.sons[i]) result = genArgNoParam(p, ri.sons[i])
discard """ discard """