Revert a2edf52: SQOpsLimiter does a more precise job (#11754)

This commit is contained in:
Loïc Guilloux
2024-01-12 17:04:43 +01:00
committed by GitHub
parent 1101b04371
commit 28efa65e0c
4 changed files with 30 additions and 11 deletions

View File

@@ -9,7 +9,6 @@
#include "../../stdafx.h"
#include "script_list.hpp"
#include "script_controller.hpp"
#include "../../debug.h"
#include "../../script/squirrel.hpp"
@@ -914,16 +913,6 @@ SQInteger ScriptList::Valuate(HSQUIRRELVM vm)
}
}
/* Kill the script when the valuator call takes way too long.
* Triggered by nesting valuators, which then take billions of iterations. */
if (ScriptController::GetOpsTillSuspend() < -1000000) {
/* See below for explanation. The extra pop is the return value. */
sq_pop(vm, nparam + 4);
ScriptObject::SetAllowDoCommand(backup_allow);
return sq_throwerror(vm, "excessive CPU usage in valuator function");
}
/* Was something changed? */
if (previous_modification_count != this->modifications) {
/* See below for explanation. The extra pop is the return value. */