From 594a0c2008fa999a167f00883e59cf8797b92da1 Mon Sep 17 00:00:00 2001 From: Leonard2 Date: Sat, 29 Oct 2016 01:30:05 +0200 Subject: [PATCH] Fixed: FxVMFunctionCall didn't check for varargs while checking argument count --- src/scripting/codegeneration/codegen.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/scripting/codegeneration/codegen.cpp b/src/scripting/codegeneration/codegen.cpp index 903a0fe139..4c048c452a 100644 --- a/src/scripting/codegeneration/codegen.cpp +++ b/src/scripting/codegeneration/codegen.cpp @@ -5785,7 +5785,7 @@ FxExpression *FxVMFunctionCall::Resolve(FCompileContext& ctx) { bool foundvarargs = false; PType * type = nullptr; - if (ArgList->Size() + implicit > proto->ArgumentTypes.Size()) + if (argtypes.Last() != nullptr && ArgList->Size() + implicit > argtypes.Size()) { ScriptPosition.Message(MSG_ERROR, "Too many arguments in call to %s", Function->SymbolName.GetChars()); delete this;