squirrel_coverity.patch 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. diff --git a/external/squirrel/sqstdlib/sqstdstring.cpp b/external/squirrel/sqstdlib/sqstdstring.cpp
  2. index 33316fa..a213135 100644
  3. --- a/external/squirrel/sqstdlib/sqstdstring.cpp
  4. +++ b/external/squirrel/sqstdlib/sqstdstring.cpp
  5. @@ -116,6 +116,7 @@ SQRESULT sqstd_format(HSQUIRRELVM v,SQInteger nformatstringidx,SQInteger *outlen
  6. fmt[fpos++] = _SC('\0');
  7. }
  8. #endif
  9. + break;
  10. case 'c':
  11. if(SQ_FAILED(sq_getinteger(v,nparam,&ti)))
  12. return sq_throwerror(v,_SC("integer expected for the specified format"));
  13. diff --git a/external/squirrel/squirrel/sqfuncstate.cpp b/external/squirrel/squirrel/sqfuncstate.cpp
  14. index aff80e5..1667815 100644
  15. --- a/external/squirrel/squirrel/sqfuncstate.cpp
  16. +++ b/external/squirrel/squirrel/sqfuncstate.cpp
  17. @@ -460,6 +460,7 @@ void SQFuncState::AddInstruction(SQInstruction &i)
  18. pi._arg1 = i._arg1;
  19. return;
  20. }
  21. + break;
  22. case _OP_SET:
  23. case _OP_NEWSLOT:
  24. if(i._arg0 == i._arg3) {
  25. diff --git a/external/squirrel/squirrel/sqlexer.cpp b/external/squirrel/squirrel/sqlexer.cpp
  26. index 547835b..f4d4d04 100644
  27. --- a/external/squirrel/squirrel/sqlexer.cpp
  28. +++ b/external/squirrel/squirrel/sqlexer.cpp
  29. @@ -18,7 +18,24 @@
  30. #define TERMINATE_BUFFER() {_longstr.push_back(_SC('\0'));}
  31. #define ADD_KEYWORD(key,id) _keywords->NewSlot( SQString::Create(ss, _SC(#key)) ,SQInteger(id))
  32. -SQLexer::SQLexer(){}
  33. +SQLexer::SQLexer() :
  34. + _curtoken(0),
  35. + _keywords(NULL),
  36. + _reached_eof(false),
  37. + _prevtoken(0),
  38. + _currentline(0),
  39. + _lasttokenline(0),
  40. + _currentcolumn(0),
  41. + _svalue(NULL),
  42. + _nvalue(0),
  43. + _fvalue(0.0),
  44. + _readf(NULL),
  45. + _up(NULL),
  46. + _currdata('\0'),
  47. + _sharedstate(NULL),
  48. + _errfunc(NULL),
  49. + _errtarget(NULL)
  50. +{}
  51. SQLexer::~SQLexer()
  52. {
  53. _keywords->Release();
  54. @@ -192,6 +209,7 @@ SQInteger SQLexer::Lex()
  55. NEXT();
  56. if (CUR_CHAR != _SC('=')){ RETURN_TOKEN('!')}
  57. else { NEXT(); RETURN_TOKEN(TK_NE); }
  58. + break;
  59. case _SC('@'): {
  60. SQInteger stype;
  61. NEXT();
  62. @@ -203,6 +221,7 @@ SQInteger SQLexer::Lex()
  63. }
  64. Error(_SC("error parsing the string"));
  65. }
  66. + break;
  67. case _SC('"'):
  68. case _SC('\''): {
  69. SQInteger stype;
  70. @@ -211,6 +230,7 @@ SQInteger SQLexer::Lex()
  71. }
  72. Error(_SC("error parsing the string"));
  73. }
  74. + break;
  75. case _SC('{'): case _SC('}'): case _SC('('): case _SC(')'): case _SC('['): case _SC(']'):
  76. case _SC(';'): case _SC(','): case _SC('?'): case _SC('^'): case _SC('~'):
  77. {SQInteger ret = CUR_CHAR;
  78. diff --git a/external/squirrel/squirrel/sqvm.cpp b/external/squirrel/squirrel/sqvm.cpp
  79. index de0927f..e941231 100644
  80. --- a/external/squirrel/squirrel/sqvm.cpp
  81. +++ b/external/squirrel/squirrel/sqvm.cpp
  82. @@ -306,6 +306,7 @@ bool SQVM::ToString(const SQObjectPtr &o,SQObjectPtr &res)
  83. }
  84. }
  85. }
  86. + break;
  87. default:
  88. scsprintf(_sp(rsl(sizeof(void*)+20)),_SC("(%s : 0x%p)"),GetTypeName(o),(void*)_rawval(o));
  89. }
  90. @@ -561,6 +562,7 @@ bool SQVM::FOREACH_OP(SQObjectPtr &o1,SQObjectPtr &o2,SQObjectPtr
  91. _generator(o1)->Resume(this, o3);
  92. _FINISH(0);
  93. }
  94. + break;
  95. default:
  96. Raise_Error(_SC("cannot iterate %s"), GetTypeName(o1));
  97. }
  98. @@ -724,6 +726,7 @@ exception_restore:
  99. continue;
  100. }
  101. }
  102. + break;
  103. case _OP_CALL: {
  104. SQObjectPtr clo = STK(arg1);
  105. switch (type(clo)) {