Commit Graph

249 Commits

Author SHA1 Message Date
PKEuS ab1113fb16 Fixed crash on garbage code #6859 2015-07-22 13:33:24 +02:00
Daniel Marjamäki ffc707246b ValueFlow: Better handling of Known/Possible values after conditional unknown function call 2015-07-21 17:56:40 +02:00
Daniel Marjamäki 749bb34deb Fixed #6830 (ValueFlow: value of switch-variable inside switch) 2015-07-20 19:45:38 +02:00
Daniel Marjamäki c0880c8d79 ValueFlow: Values that are assigned in switch are possible after switch 2015-07-20 09:36:56 +02:00
Daniel Marjamäki ce7e879460 ValueFlow: isVariableChanged() should return true when variable is changed by passing its address to subfunction 2015-07-18 15:35:39 +02:00
Daniel Marjamäki 5aa0b284dc ValueFlow: Evaluate more calculations when operands have known values 2015-07-18 15:03:57 +02:00
Daniel Marjamäki 25d9ebedd8 ValueFlow: fixed known/possible value of static variable 2015-07-17 20:48:37 +02:00
Daniel Marjamäki f1e410a878 ValueFlow: value that is changed in do while loop must be possible instead of known. 2015-07-17 20:30:34 +02:00
Daniel Marjamäki 69c1a7ecb1 ValueFlow: default argument values are not known, they are possible 2015-07-17 16:05:07 +02:00
Daniel Marjamäki 577ab1c2ac ValueFlow: result of ? is not 'known' 2015-07-17 15:22:24 +02:00
Daniel Marjamäki 61cf224f32 ValueFlow: Make known loop value possible 2015-07-17 10:24:24 +02:00
Daniel Marjamäki 9bdee7fce9 ValueFlow: Refactoring setTokenValue() 2015-07-17 09:46:31 +02:00
Daniel Marjamäki 3d5781743c ValueFlow: Restore handling of not 2015-07-16 21:17:44 +02:00
Daniel Marjamäki 15a8e4d2df Temporarily revert "Fixed #4842 (condition is always true (variable is assigned constant value and then used in condition))"
This reverts commit a3fbad50cb.

The ValueFlow must be updated before this can be re-added.
2015-07-16 21:10:46 +02:00
Daniel Marjamäki 09efe140fe ValueFlow: Change value to 'Possible' after conditional assignment in inner loop 2015-07-16 21:08:32 +02:00
Daniel Marjamäki 38214b6907 ValueFlow: function arguments only has 'possible' values 2015-07-16 20:49:14 +02:00
Daniel Marjamäki a3fbad50cb Fixed #4842 (condition is always true (variable is assigned constant value and then used in condition)) 2015-07-16 20:17:57 +02:00
Daniel Marjamäki 88491267d6 ValueFlow: Added Value::valueKind that says if value is known or possible 2015-07-16 17:33:16 +02:00
Alexander Mai b604d63dd8 #6726 cppcheck hangs with 100% CPU load (invalidcode) inside Token::astOperand2(). #6840 egmentation fault (invalid code) in Token::astOperand2. Improve stability on invalid code 2015-07-15 15:19:48 +02:00
Daniel Marjamäki 405a1fba11 ValueFlow: set values for false/true 2015-07-14 18:02:26 +02:00
Daniel Marjamäki 7ccd30362c Fixed #6826 (False positive: ValueFlow conditional value used in condition) 2015-07-12 19:35:47 +02:00
Daniel Marjamäki f3b4c1d0db Remove some useless casts, probably added to avoid false positives. 2015-07-04 13:19:21 +02:00
Daniel Marjamäki b8e77c8005 valueflow: fix for ?:. the condition result is not a result of the ?. 2015-07-04 11:17:38 +02:00
Daniel Marjamäki 7e1ddea653 One more fix for #6811 (ValueFlow: result of ?:) 2015-07-02 20:52:04 +02:00
Daniel Marjamäki c751039612 Fixed #6811 (ValueFlow: result of ?:) 2015-07-02 20:11:27 +02:00
Daniel Marjamäki 75b0430ba5 Token::strValue: fixed handling of backslash 2015-06-07 11:25:33 +02:00
Simon Martin 98e6dca4f2 Ticket #6713: Properly detect ternary operator in valueFlowForward. 2015-05-30 20:55:36 +02:00
amai2012 729b240d9c Refactoring (compiler warnings and a typo) 2015-05-25 23:15:59 +02:00
Daniel Marjamäki eb0db322eb Fixed #6560 (ValueFlow: handling ternary operator better in valueFlowSubFunction) 2015-05-24 17:02:00 +02:00
PKEuS 3ce4e68ca6 Refactorization: Make use of do-loops to avoid redundant Token::Match() calls 2015-05-13 13:40:40 +02:00
Daniel Marjamäki ca1f19b6d4 Fixed #6378 (valueFlowForward: decrement not handled) 2015-05-02 17:30:09 +02:00
Dmitry-Me 8a4033e13a Omit unneeded actions 2015-03-24 16:01:59 +03:00
Jakub Melka b7d92a4fc7 Fixed warnings of CppCheck's own code (caused by new check #695) 2015-03-08 18:18:09 +01:00
Daniel Marjamäki d1892786b8 ValueFlow: Improved when using '[' on arrays and strings 2015-02-24 15:57:39 +01:00
Dmitry-Me dfd19233e9 Simplify loop logic 2015-02-09 14:40:17 +03:00
Dmitry-Me 6eacb4957c Simplify ternary operators, use else-if to avoid extra comparison 2015-02-09 11:46:27 +03:00
Dmitry-Me fd0155cacf Reuse already known values 2015-02-09 10:23:36 +03:00
Daniel Marjamäki 8a1b8df1ba ValueFlow: Improved handling of alias values in valueFlowForward 2015-02-08 19:20:05 +01:00
Daniel Marjamäki 1d873de67f Fix testrunner 2015-02-07 19:44:33 +01:00
Daniel Marjamäki 62a5d88eb0 ValueFlow: Improved handling of strings 2015-02-07 18:14:22 +01:00
Matthias Krüger dd70b6e0cd fix internal message: [lib/valueflow.cpp:239]: (warning) Found simple pattern inside Token::Match() call: "} ;" 2015-02-07 12:51:17 +01:00
Daniel Marjamäki 29db3eb848 Fixed #5980 (ValueFlow: pointer cant be 0 below throw in switch) 2015-02-07 10:45:30 +01:00
PKEuS f1714110d0 Fixed crash if double constants are passed as default arguments (#6494) 2015-02-03 22:12:05 +01:00
Dmitry-Me c05e632baf Cache and reuse value 2015-02-03 11:00:40 +03:00
PKEuS 451a277b18 Refactorization: Support function default values in ValueFlow, removed now obsolete CheckNullPointer::nullPointerDefaultArgument().
-> Use valueFlowForward() to parse values passed to functions
-> valueFlowForward(): Set value in first occurrence of a variable in a condition
2015-02-01 15:15:00 +01:00
PKEuS b74b94b1e6 Partially reverted previous commit - std::vetcor instance creation can't be avoided without generating lots of debug messages 2015-02-01 12:33:53 +01:00
PKEuS 58c3fdd063 Fixed crash on garbage code introduced recently, optimized code in valueFlowFunctionReturn. 2015-02-01 12:26:46 +01:00
PKEuS a4cc4c3e3f Refactorization: Use SymbolDatabase scope information in ValueFlow 2015-02-01 12:10:20 +01:00
PKEuS b2835051df Refactorization: Renamed Token::Match pattern %var% to %name%, implement new pattern %var% which is true if varId > 0. 2015-01-31 12:32:04 +01:00
PKEuS 33f5d27b53 Fixed varId0 message #6443. 2015-01-31 10:33:32 +01:00