Mercurial > hg > openttd
changeset 13021:1eb5973d8908 draft
(svn r17515) -Fix [FS#3189]: [Squirrel] In some cases the call stack would not be cleaned up properly during crash handling. Occasionally this causes asserts to be triggered or crashes.
author | rubidium <rubidium@openttd.org> |
---|---|
date | Sat, 12 Sep 2009 20:31:41 +0000 |
parents | 70177bd7372b |
children | 006f65defb20 |
files | src/3rdparty/squirrel/squirrel/sqvm.cpp |
diffstat | 1 files changed, 5 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/3rdparty/squirrel/squirrel/sqvm.cpp +++ b/src/3rdparty/squirrel/squirrel/sqvm.cpp @@ -1165,6 +1165,8 @@ } + /* Store the call stack size, so we can restore that */ + SQInteger cstksize = _callsstacksize; SQInteger ret; try { SQBool can_suspend = this->_can_suspend; @@ -1175,6 +1177,7 @@ _nnativecalls--; suspend = false; + _callsstacksize = cstksize; _stackbase = oldstackbase; _top = oldtop; @@ -1184,6 +1187,8 @@ throw; } + assert(cstksize == _callsstacksize); + _nnativecalls--; suspend = false; if( ret == SQ_SUSPEND_FLAG) suspend = true;