From 91bd00aeeeccc16d3ec2d648f174874d3e8a9019 Mon Sep 17 00:00:00 2001 From: mathnerd314 Date: Tue, 9 Feb 2010 22:06:41 +0000 Subject: [PATCH] Update squirrel to 2.2.4 (keeping const-correctness of sqstdstream) git-svn-id: http://supertux.lethargik.org/svn/supertux/trunk/supertux@6311 837edb03-e0f3-0310-88ca-d4d4e8b29345 --- external/squirrel/HISTORY | 4 ++++ external/squirrel/README | 2 +- external/squirrel/include/squirrel.h | 2 +- external/squirrel/squirrel/sqvm.cpp | 4 ++-- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/external/squirrel/HISTORY b/external/squirrel/HISTORY index b6dcc8309..6c2947407 100644 --- a/external/squirrel/HISTORY +++ b/external/squirrel/HISTORY @@ -1,3 +1,7 @@ +***version 2.2.4 stable*** +-fixed bug in functions with default parameters + +***2009-06-30 *** ***version 2.2.3 stable*** -added sq_getfunctioninfo -added compile time flag SQUSEDOUBLE to use double precision floats diff --git a/external/squirrel/README b/external/squirrel/README index 5bd1cd4f4..c46c92345 100644 --- a/external/squirrel/README +++ b/external/squirrel/README @@ -1,4 +1,4 @@ -The programming language SQUIRREL 2.2.3 stable +The programming language SQUIRREL 2.2.4 stable -------------------------------------------------- The project has been compiled and run on Windows(Windows XP/2000 on Intel x86 Windows XP Pro on AMD x64) and diff --git a/external/squirrel/include/squirrel.h b/external/squirrel/include/squirrel.h index 7d2f9a053..141908dc7 100644 --- a/external/squirrel/include/squirrel.h +++ b/external/squirrel/include/squirrel.h @@ -157,7 +157,7 @@ typedef char SQChar; #define MAX_CHAR 0xFF #endif -#define SQUIRREL_VERSION _SC("Squirrel 2.2.3 stable") +#define SQUIRREL_VERSION _SC("Squirrel 2.2.4 stable") #define SQUIRREL_COPYRIGHT _SC("Copyright (C) 2003-2009 Alberto Demichelis") #define SQUIRREL_AUTHOR _SC("Alberto Demichelis") diff --git a/external/squirrel/squirrel/sqvm.cpp b/external/squirrel/squirrel/sqvm.cpp index 9b1827ae1..d24319388 100644 --- a/external/squirrel/squirrel/sqvm.cpp +++ b/external/squirrel/squirrel/sqvm.cpp @@ -327,8 +327,8 @@ bool SQVM::StartCall(SQClosure *closure,SQInteger target,SQInteger args,SQIntege SQInteger nargs = args; if (paramssize != nargs) { SQInteger ndef = func->_ndefaultparams; - if(ndef && nargs < paramssize) { - SQInteger diff = paramssize - nargs; + SQInteger diff; + if(ndef && nargs < paramssize && (diff = paramssize - nargs) <= ndef) { for(SQInteger n = ndef - diff; n < ndef; n++) { _stack._vals[stackbase + (nargs++)] = closure->_defaultparams[n]; } -- 2.11.0