Commit Graph

361 Commits

Author SHA1 Message Date
Daniel Marjamäki 17aaecbd6b ValueFlow: Improved handling of sizeof 2016-12-18 14:03:48 +01:00
Daniel Marjamäki 4ac5c78e0c Fix wrong iterator usage. Iterator that is erased must be non-const. 2016-12-17 22:20:50 +01:00
Daniel Marjamäki 72e4bc9d88 ValueFlow: skip values that cause false assertion condition 2016-12-17 21:23:14 +01:00
Daniel Marjamäki fd85b493bd astyle formatting
[ci skip]
2016-12-17 18:51:16 +01:00
Frank Zingsheim cb5a5e6a25 Improve Fix #6180 (Access of moved variable still allowed until function is called) 2016-12-17 16:42:46 +01:00
Frank Zingsheim 9a871d33f7 Improve Fix #6180 ("reset" and "clear" clears the move status) 2016-12-17 16:39:30 +01:00
Frank Zingsheim f4ab45f13b Improve Fix #6180 (Do not warn about move if it is part of a reassignment of the variable) 2016-12-17 16:39:30 +01:00
Daniel Marjamäki 31337dda27 ValueFlow: Better handling of && and || in for loop to avoid FP 2016-12-11 21:19:24 +01:00
Frank Zingsheim e0d4720e19 Fix #7829 (false-positive: knownConditionTrueFalse linked to virtual method)
Return values of virtual functions in valueflow are only possible values
since function might be overloaded.
2016-12-11 10:44:05 +01:00
Daniel Marjamäki b098d5fbd6 ValueFlow: We need better handling of casts 2016-12-10 22:09:01 +01:00
PKEuS 2f6350a0d0 Refactorized Library 2016-12-06 14:09:28 +01:00
PKEuS 6e8ac13325 Refactorization:
- Optimized std::string usage
- Replaced list by vector
- Moved iterator into loop head
- Ran AStyle
2016-12-05 17:45:34 +01:00
Daniel Marjamäki 5df8e7f50c Fixed #7596 (ValueFlow: better handling for 'x*(1-x-1)') 2016-12-04 22:39:59 +01:00
Stefan Weil 57b57428c2 Fix some typos in comments (found by codespell)
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2016-11-27 11:40:42 +01:00
Matthias Krüger 213589ee68 ValueFlow: don't perform UB when a function returns shifts of/by negative values. Fixes #7814. 2016-11-24 23:23:47 +01:00
Daniel Marjamäki d40f4e4a55 Fixed #7778 (valueFlowAfterAssign: alias) 2016-11-21 17:26:36 +01:00
Frank Zingsheim c8ff96fe8f Fixed #6180 (Usage of variable after std::move or std::forward) 2016-11-20 15:14:49 +01:00
Matthias Krüger b6614d0aa4 valueflow: bail out earlier when encountering divisions by zero. Fixes #7819.
This caused valueflow to actually try to divide by zero, detected by UBSAN.
2016-11-20 14:38:35 +01:00
Daniel Marjamäki 3b57273ef1 Fix Cppcheck warnings 2016-11-14 07:21:10 +01:00
Daniel Marjamäki 1e31c6c01c ValueFlow: Extended handling of float values 2016-11-14 06:42:52 +01:00
Daniel Marjamäki e1e9eacccc ValueFlow: Added float type 2016-11-13 22:59:56 +01:00
Daniel Marjamäki 4732667488 ValueFlow: allow more value types 2016-11-13 22:33:39 +01:00
Daniel Marjamäki 7ebfb10edd Fixed #7806 (ValueFlow: better handling of subfunction with early return) 2016-11-13 18:19:51 +01:00
Daniel Marjamäki ac7b351d1e ValueFlow: Don't calculate x<<64 and x>>64 2016-11-06 20:40:58 +01:00
Daniel Marjamäki dd69d5eabe ValueFlow: Don't calculate result when there is UB 2016-11-06 17:42:01 +01:00
Alexander Mai ee11f0974a #7769 segmentation fault at setTokenValue() on invalid code. 2016-11-06 14:20:58 +01:00
Daniel Marjamäki ece4b1a06f Fix ValueFlow 2016-11-05 09:59:48 +01:00
Daniel Marjamäki 2885a75ea6 ValueFlow: handle ~ in setTokenValue 2016-11-05 09:29:22 +01:00
Frank Zingsheim d4f01583b6 Fixed TODO (check if function parameter is non-const reference etc..) by common function 2016-11-01 14:06:30 +01:00
Robert Reif 4216b26b8c Fixed #7775 (crash at valueFlowSetConstantValue) 2016-10-26 10:36:02 +02:00
Daniel Marjamäki 8a0f3009ff ValueFlow: inner and outer function return values 2016-10-22 17:22:57 +02:00
Daniel Marjamäki 77cd6c194f ValueFlow: Set 'known' property for function return values 2016-10-22 12:24:15 +02:00
Daniel Marjamäki 86a620a3b4 ValueFlow: Better handling of function return value when there are 0 parameters 2016-10-20 16:10:55 +02:00
Daniel Marjamäki efa3aba32a Remove Tokenizer::simplifyNull() 2016-10-18 21:44:02 +02:00
Daniel Marjamäki fae4a4dacf Fixed #7668 (ValueFlow: return value from abs) 2016-10-17 13:05:19 +02:00
Daniel Marjamäki 7fb812f415 Fixed #7752 (ValueFlow: no conditional value, probably because condition is in ternary operator and/or in function call.) 2016-10-16 07:15:28 +02:00
Daniel Marjamäki ad74421526 Fixed #7756 (ValueFlow: fix bug in valueAfterAssign, same variable in lhs and rhs) 2016-10-15 19:09:50 +02:00
Boris Egorov a32f61ae4a Fixed #7139 (ValueFlow: Missed shift operation in for expression) 2016-10-04 13:09:33 +07:00
Daniel Marjamäki 254e5675ff Fixed #7573 (Tokenizer: FP caused by constant folding) 2016-08-28 19:11:05 +02:00
PKEuS e0838ff194 Fixed crash on garbage code (#7699) 2016-08-21 11:06:48 +02:00
Daniel Marjamäki 305609f4fb Fixed #7688 (setTokenValue: crash when there is no 2nd operand for ternary operator) 2016-08-17 18:44:41 +02:00
Daniel Marjamäki 1f98af654a ValueFlow: better handling of ? when condition result is known 2016-08-15 14:19:35 +02:00
Daniel Marjamäki 62362cd06d ValueFlow: improve handling of unary minus 2016-08-14 22:19:06 +02:00
PKEuS 9a6569fde1 Always set ErrorMessage::file0 to ensure that the source file that cppcheck is checking when an error occurs can be identified
Removed unused function and unused includes from preprocessor.h/cpp
2016-07-26 16:28:40 +02:00
Daniel Marjamäki 4f051bf9dd Fixed #7599 (valueFlowAST: handle && and || better) 2016-07-17 21:51:20 +02:00
Robert Reif eca805ba3b ValueFlow: Fixed constant folding of sizeof(enum) and sizeof(enumerator) (#7564) 2016-07-08 20:39:34 +02:00
Robert Reif 66cacde3db Fixed #7513 (value flow of array dimension with enum doesn't always work) 2016-05-26 11:25:50 +02:00
Daniel Marjamäki 636e97c272 ValueType: Improved debug output for nested types 2016-05-08 13:15:20 +02:00
Daniel Marjamäki b94eaeca6a ValueFlow: For convenience, return constant folded value 2016-05-08 11:17:10 +02:00
Daniel Marjamäki b26dd1ccab ValueFlow: Handle enums 2016-05-07 20:18:07 +02:00