Fixed potential crash when calling undefined function in ZScript

The following code which uses explicit class specifier led to a crash:
class C
{
	void F()
	{
		Object.Undefined();
	}
}
This commit is contained in:
alexey.lysiuk 2017-12-23 15:27:32 +02:00
parent b9a2398935
commit d50ba4954a

View file

@ -8091,7 +8091,7 @@ FxExpression *FxMemberFunctionCall::Resolve(FCompileContext& ctx)
{ {
bool error; bool error;
PFunction *afd = FindClassMemberFunction(ccls, ctx.Class, MethodName, ScriptPosition, &error); PFunction *afd = FindClassMemberFunction(ccls, ctx.Class, MethodName, ScriptPosition, &error);
if ((afd->Variants[0].Flags & VARF_Method) && (afd->Variants[0].Flags & VARF_Virtual)) if ((nullptr != afd) && (afd->Variants[0].Flags & VARF_Method) && (afd->Variants[0].Flags & VARF_Virtual))
{ {
staticonly = false; staticonly = false;
novirtual = true; novirtual = true;