mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-24 21:21:04 +00:00
Fixed potential crash in ACS engine
Unknown p-code in compiled script may lead to a crash if the current module was changed during script execution, e.g. by function call See http://forum.zdoom.org/viewtopic.php?f=2&t=48524
This commit is contained in:
parent
211f12286a
commit
b2fa4970fd
1 changed files with 2 additions and 0 deletions
|
@ -6032,6 +6032,7 @@ int DLevelScript::RunScript ()
|
|||
int sp = 0;
|
||||
int *pc = this->pc;
|
||||
ACSFormat fmt = activeBehavior->GetFormat();
|
||||
FBehavior* const savedActiveBehavior = activeBehavior;
|
||||
unsigned int runaway = 0; // used to prevent infinite loops
|
||||
int pcd;
|
||||
FString work;
|
||||
|
@ -6065,6 +6066,7 @@ int DLevelScript::RunScript ()
|
|||
{
|
||||
default:
|
||||
Printf ("Unknown P-Code %d in %s\n", pcd, ScriptPresentation(script).GetChars());
|
||||
activeBehavior = savedActiveBehavior;
|
||||
// fall through
|
||||
case PCD_TERMINATE:
|
||||
DPrintf ("%s finished\n", ScriptPresentation(script).GetChars());
|
||||
|
|
Loading…
Reference in a new issue