Merge branch 'master' into jgrpp

# Conflicts:
#	config.lib
This commit is contained in:
Jonathan G Rennison
2016-06-02 19:25:23 +01:00
6 changed files with 46 additions and 22 deletions

View File

@@ -11,6 +11,7 @@
#include "../../stdafx.h"
#include "script_list.hpp"
#include "script_controller.hpp"
#include "../../debug.h"
#include "../../script/squirrel.hpp"
@@ -905,6 +906,16 @@ 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. */