Fix another round of squirrel coverity issues
authorTobias Markus <tobbi@mozilla-uk.org>
Tue, 3 Mar 2015 18:06:18 +0000 (19:06 +0100)
committerTobias Markus <tobbi@mozilla-uk.org>
Tue, 3 Mar 2015 18:09:17 +0000 (19:09 +0100)
squirrel_coverity.patch

index 5648319..60112e2 100644 (file)
@@ -23,10 +23,36 @@ index aff80e5..1667815 100644
                case _OP_NEWSLOT:\r
                        if(i._arg0 == i._arg3) {\r
 diff --git a/external/squirrel/squirrel/sqlexer.cpp b/external/squirrel/squirrel/sqlexer.cpp
-index 547835b..9df5f1f 100644
+index 547835b..f4d4d04 100644
 --- a/external/squirrel/squirrel/sqlexer.cpp
 +++ b/external/squirrel/squirrel/sqlexer.cpp
-@@ -192,6 +192,7 @@ SQInteger SQLexer::Lex()
+@@ -18,7 +18,24 @@
+ #define TERMINATE_BUFFER() {_longstr.push_back(_SC('\0'));}\r
+ #define ADD_KEYWORD(key,id) _keywords->NewSlot( SQString::Create(ss, _SC(#key)) ,SQInteger(id))\r
\r
+-SQLexer::SQLexer(){}\r
++SQLexer::SQLexer() :\r
++  _curtoken(0),\r
++  _keywords(NULL),\r
++  _reached_eof(false),\r
++  _prevtoken(0),\r
++  _currentline(0),\r
++  _lasttokenline(0),\r
++  _currentcolumn(0),\r
++  _svalue(NULL),\r
++  _nvalue(0),\r
++  _fvalue(0.0),\r
++  _readf(NULL),\r
++  _up(NULL),\r
++  _currdata('\0'),\r
++  _sharedstate(NULL),\r
++  _errfunc(NULL),\r
++  _errtarget(NULL)\r
++{}\r
+ SQLexer::~SQLexer()\r
+ {\r
+       _keywords->Release();\r
+@@ -192,6 +209,7 @@ SQInteger SQLexer::Lex()
                        NEXT();\r
                        if (CUR_CHAR != _SC('=')){ RETURN_TOKEN('!')}\r
                        else { NEXT(); RETURN_TOKEN(TK_NE); }\r
@@ -34,7 +60,15 @@ index 547835b..9df5f1f 100644
                case _SC('@'): {\r
                        SQInteger stype;\r
                        NEXT();\r
-@@ -211,6 +212,7 @@ SQInteger SQLexer::Lex()
+@@ -203,6 +221,7 @@ SQInteger SQLexer::Lex()
+                       }\r
+                       Error(_SC("error parsing the string"));\r
+                                          }\r
++            break;\r
+               case _SC('"'):\r
+               case _SC('\''): {\r
+                       SQInteger stype;\r
+@@ -211,6 +230,7 @@ SQInteger SQLexer::Lex()
                        }\r
                        Error(_SC("error parsing the string"));\r
                        }\r
@@ -70,15 +104,3 @@ index de0927f..e941231 100644
                        case _OP_CALL: {\r
                                        SQObjectPtr clo = STK(arg1);\r
                                        switch (type(clo)) {\r
-diff --git a/external/squirrel/squirrel/sqlexer.cpp b/external/squirrel/squirrel/sqlexer.cpp
-index 547835b..178401d 100644
---- a/external/squirrel/squirrel/sqlexer.cpp
-+++ b/external/squirrel/squirrel/sqlexer.cpp
-@@ -203,6 +203,7 @@ SQInteger SQLexer::Lex()
-                       }\r
-                       Error(_SC("error parsing the string"));\r
-                                          }\r
-+            break;\r
-               case _SC('"'):\r
-               case _SC('\''): {\r
-                       SQInteger stype;\r