Mercurial > hg > openttd
changeset 19108:6047aa9ac399 draft
(svn r23962) -Fix [FS#5068]: [Script] Infinite recursion within a script wasn't caught properly, so they could cause crashes of OpenTTD instead of the AI
author | rubidium <rubidium@openttd.org> |
---|---|
date | Fri, 17 Feb 2012 21:49:53 +0000 |
parents | e4c02198af94 |
children | 1c4d02086213 |
files | src/3rdparty/squirrel/squirrel/sqvm.h |
diffstat | 1 files changed, 4 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/3rdparty/squirrel/squirrel/sqvm.h +++ b/src/3rdparty/squirrel/squirrel/sqvm.h @@ -200,6 +200,10 @@ #define PUSH_CALLINFO(v,nci){ \ if(v->_callsstacksize == v->_alloccallsstacksize) { \ + if (v->_callsstacksize > 65535) {\ + v->Raise_Error(_SC("stack overflow"));\ + return false;\ + }\ v->GrowCallStack(); \ } \ v->ci = &v->_callsstack[v->_callsstacksize]; \