From b94801b99435489c2e18687e88529abc3808aba0 Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Thu, 19 Jul 2018 13:38:49 +0300 Subject: [PATCH] - fixed crash on accessing state owner during VM abort https://forum.zdoom.org/viewtopic.php?t=61338 --- src/info.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/info.cpp b/src/info.cpp index 28feeb826..77ce115e6 100644 --- a/src/info.cpp +++ b/src/info.cpp @@ -161,14 +161,18 @@ bool FState::CallAction(AActor *self, AActor *stateowner, FStateParamInfo *info, catch (CVMAbortException &err) { err.MaybePrintMessage(); - const char *callinfo = ""; - if (info != nullptr && info->mStateType == STATE_Psprite) + + if (stateowner != nullptr) { - if (stateowner->IsKindOf(NAME_Weapon) && stateowner != self) callinfo = "weapon "; - else callinfo = "overlay "; + const char *callinfo = ""; + if (info != nullptr && info->mStateType == STATE_Psprite) + { + if (stateowner->IsKindOf(NAME_Weapon) && stateowner != self) callinfo = "weapon "; + else callinfo = "overlay "; + } + err.stacktrace.AppendFormat("Called from %sstate %s in %s\n", callinfo, FState::StaticGetStateName(this).GetChars(), stateowner->GetClass()->TypeName.GetChars()); } - err.stacktrace.AppendFormat("Called from %sstate %s in %s\n", callinfo, FState::StaticGetStateName(this).GetChars(), stateowner->GetClass()->TypeName.GetChars()); - throw; + throw; }