From 63035d5031d253f793dfef090322dd8fe5f297c3 Mon Sep 17 00:00:00 2001 From: Player701 Date: Mon, 19 Oct 2020 12:03:03 +0300 Subject: [PATCH] - Prevent calling abstract functions via Super or parent class name qualifiers at compile time --- src/common/scripting/backend/codegen.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/common/scripting/backend/codegen.cpp b/src/common/scripting/backend/codegen.cpp index d17c47cad3..cb9642a643 100644 --- a/src/common/scripting/backend/codegen.cpp +++ b/src/common/scripting/backend/codegen.cpp @@ -8546,6 +8546,13 @@ FxExpression *FxVMFunctionCall::Resolve(FCompileContext& ctx) if (!result) return nullptr; } + // [Player701] Catch attempts to call abstract functions directly at compile time + if (NoVirtual && Function->Variants[0].Implementation->VarFlags & VARF_Abstract) + { + ScriptPosition.Message(MSG_ERROR, "Cannot call abstract function %s", Function->Variants[0].Implementation->PrintableName.GetChars()); + delete this; + return nullptr; + } CallingFunction = ctx.Function; if (ArgList.Size() > 0)