Commit Graph

5861 Commits

Author SHA1 Message Date
PKEuS 39b64ea5fb Simplify rValue reference arguments without name (&& -> & &) 2014-06-04 18:45:56 +02:00
PKEuS 8db0790407 Tokenizer::tokenize() can now be called without AST being created 2014-06-04 18:45:28 +02:00
PKEuS d93d7401c6 Moved getSourceFilePath(), isC() and isCPP() from Tokenizer to TokenList
Conflicts:
	lib/tokenize.cpp
2014-06-04 18:36:25 +02:00
PKEuS 6aa88248ac Fixed timer name 2014-06-04 18:34:45 +02:00
orbitcowboy 8fe163285f MathLib: Added missing testcase for incdec. 2014-06-04 08:41:30 +02:00
orbitcowboy 60e80b6fb1 Fixed #5885 - fsanitize=undefined: signed integer overflow: 2147483647 + 1 cannot be represented in type 'int' in lib/tokenize.cpp. 2014-05-29 18:25:01 +02:00
orbitcowboy e9144d1a78 Fixed #5890 - crash: wesnoth desktop_util.cpp / unicode.hpp. 2014-05-29 02:58:18 +02:00
Robert Reif e5ae575ace Fixed #5867 (invalid debug warnung: Scope::checkVariable : varid0) 2014-06-02 06:18:32 +02:00
Alexander Mai ad1662a201 #5875 fix 'lib/checksizeof.cpp:142:26: runtime error: member call on null pointer of type 'Token'. Improve error handling in CheckSizeof::checkSizeofForPointerSize() 2014-06-01 22:18:17 +02:00
Daniel Marjamäki 42140b6488 Preprocessor: set error flag when unhandled characters are found so checking can bailout 2014-06-01 11:24:10 +02:00
Martin Ettl af369b4925 astyle run [ci skip] 2014-05-16 23:01:21 +02:00
amai2012 6f31ce334d #5875 Fix 'lib/mathlib.cpp:559:43: runtime error: division by zero'. Several fixes to MathLib::divide(): avoid division by zero, handle various representation of 0 value, use 'nan.' instead of '-nan.0' 2014-05-31 18:25:23 +02:00
Daniel Marjamäki 46bf23aa6d TokenList: added assertion that makes sure the Preprocessor doesn't let through extended ascii wrongly. 2014-05-31 18:02:19 +02:00
amai 98ea1397b3 #5875 clang ubsan errors: lib/checkassignif.cpp:58:34: runtime error: member call on null pointer of type 'Token' 2014-05-31 15:12:04 +02:00
Daniel Marjamäki 66ad3c97b9 Fixed #5857 (strPlusChar: Crash on invalid code 'int+;') 2014-05-31 10:34:00 +02:00
PKEuS 86dede14c0 Merge pull request #327 from simartin/only_fill_if_needed
Only fill total_size in CheckBufferOverrun::checkFunctionParameter when useful
2014-05-30 20:56:33 +02:00
Daniel Marjamäki 70b4c945de Fixed #5874 (False positive: 'opposite conditions in nested if' with arrays) 2014-05-30 19:19:24 +02:00
Simon Martin f7356dd8c7 Only fill total_size in CheckBufferOverrun::checkFunctionParameter when it's useful. 2014-05-29 23:51:13 +02:00
Simon Martin 139f87af18 Ticket #5615: Avoid calling the same function n times when once is enough. 2014-05-29 19:58:09 +02:00
Daniel Marjamäki bc2ba1706b cleanup redundant valueflow check. if there are no values the getValue will return NULL. 2014-05-28 21:03:16 +02:00
PKEuS c23afbd04a Merge pull request #325 from simartin/checkio_types_match_factorize
Factorize type name equality checks in CheckIO
2014-05-27 21:46:07 +02:00
Simon Martin d2223ce419 Factorize type name equality checks in CheckIO. 2014-05-27 19:20:19 +02:00
Simon Martin 966491d40b Added a test for out-of-bounds character array access. 2014-05-27 16:21:13 +02:00
Daniel Marjamäki ed78d3e148 Library: Better error reporting when loading fails 2014-05-26 17:00:41 +02:00
PKEuS 1cb14f687f Merge pull request #322 from simartin/del_useless_fwd_decl
Remove unnecessary declaration (one line before the actual definition...)
2014-05-25 23:54:20 +02:00
PKEuS 8f083af1e4 Attempt to fix travis build 2014-05-25 22:11:56 +02:00
Simon Martin c027c526a9 Remove unnecessary declaration (one line before the actual definition... 2014-05-25 22:04:51 +02:00
PKEuS a407b55945 Added support for lambdas to AST
Fixed bug that return statement left an operand on the stack
2014-05-25 21:55:39 +02:00
PKEuS 04f3caf8e8 Fixed debug message #5159 2014-05-25 14:16:03 +02:00
PKEuS 55c87248ba Fixed crash on complex cast. 2014-05-24 20:21:08 +02:00
PKEuS d42275c5f1 Fixed TODO in checkAssignBoolToFloat 2014-05-24 20:06:45 +02:00
Alexander Mai e6a394d514 CheckBool::checkAssignBoolToFloat() - don't crash on unknown variables 2014-05-24 19:15:43 +02:00
PKEuS 38aaa46804 Stabilized AST:
- Fixed broken simplification causing crashs when cast was followed by unary minus (real world examples from arch/parisc/math-emu/ (linux-kernel))
- Stabilized determination of unary and binary operators
2014-05-24 19:05:04 +02:00
Alexander Mai 2c8087e34f #4375 New check: add style warning about 'double d=false;' Add a new check to CheckBool. Also implement Variable::isFloatingType() 2014-05-24 18:35:49 +02:00
PKEuS effa38c322 Fixed #5863 (False positive: array index is used before limits check) 2014-05-24 17:50:01 +02:00
Daniel Marjamäki bb8973aac7 Updated Makefile 2014-05-24 12:54:16 +02:00
PKEuS a04036337d Fixed #5860: Don't show returnTempReference for calculations on unknown types 2014-05-24 12:50:04 +02:00
PKEuS adf38fcfd0 Further include cleanup 2014-05-24 12:50:04 +02:00
PKEuS 1fc1ff1993 Moved implementation of two functions to new file check.cpp -> Don't include <iostream> everywhere 2014-05-24 12:50:04 +02:00
PKEuS 8f79dc3ff8 Cleaned up includes and forward declarations in checkers:
- Removed definitely unnecessary forward declarations (e.g. "class Token"; token.h is already included by check.h, so a definition is unnecessary)
 - Removed unused includes
2014-05-24 12:50:03 +02:00
amai2012 00e28de3b7 Merge pull request #315 from simartin/ticket_5823
Ticket #5823: Properly count template parameters in TemplateSimplifier::useDefaultArgumentValues
2014-05-24 11:47:14 +02:00
PKEuS b78131cfcf Improved cast detection in AST:
-> Make use of it in checkother.cpp

Use tokenizer simplification instead of reimplementation for test suite
2014-05-24 11:29:32 +02:00
PKEuS b0b0562247 Removed obsolete piece of code from checkbufferoverrun.cpp 2014-05-24 11:29:32 +02:00
Simon Martin 2b809800b6 Ticket #5823: Properly count template parameters in TemplateSimplifier::useDefaultArgumentValues and handle casts in template parameters' default values. 2014-05-23 23:38:40 +02:00
Simon Martin fcff8d39d9 Ticket #5816: Properly handle template'd template parameters in enum initializers. 2014-05-23 21:25:42 +02:00
orbitcowboy d299cae5ef Fixed typo in comment, no functional changes [ci-skip] 2014-05-23 22:31:01 +02:00
orbitcowboy 6183f21070 Fixed CID 1037088 Dereference after null check in Tokenizer::simplifyLabelsCaseDefault. 2014-05-23 21:38:56 +02:00
orbitcowboy 7920afdc60 Fixed CID 1037101 Dereference after null check in ExecutionPath::checkScope. 2014-05-23 18:27:34 +02:00
orbitcowboy 85496cfadc Fixed CID 1192595: Dereference null return value in checkother. 2014-05-23 18:11:44 +02:00
PKEuS bc0682d1e9 Enhancements related to duplicate expression checking:
- Fixed astIsFloat() for complex expressions
- Enhanced support for commutative operators (#5260)
2014-05-22 21:46:48 +02:00