From cf8c05c9c45b70450dfaf4630d6bd33fae76a91e Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Thu, 21 Nov 2019 16:58:28 +0200 Subject: [PATCH] - fixed missing checks for function calls from DECORATE State functions could call ZScript code with incompatible self pointer, e.g. weapon's function could be called with self pointed to player pawn DECORATE scripts that contain such errors are no longer accepted https://forum.zdoom.org/viewtopic.php?t=66429 --- src/scripting/decorate/thingdef_exp.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/scripting/decorate/thingdef_exp.cpp b/src/scripting/decorate/thingdef_exp.cpp index 4a1a82922..9b78a5f28 100644 --- a/src/scripting/decorate/thingdef_exp.cpp +++ b/src/scripting/decorate/thingdef_exp.cpp @@ -510,7 +510,8 @@ static FxExpression *ParseExpression0 (FScanner &sc, PClassActor *cls) sc.UnGet(); ParseFunctionParameters(sc, cls, args, func, "", nullptr); } - return new FxVMFunctionCall(new FxSelf(sc), func, args, sc, false); + // FxVMFunctionCall cannot be used here as it lacks some important checks + return new FxFunctionCall(identifier, NAME_None, args, sc); } }