Commit Graph

328 Commits

Author SHA1 Message Date
Daniel Marjamäki a02fd54a69 ValueFlow: Avoid FPs for aliased variables 2017-09-03 23:24:55 +02:00
Daniel Marjamäki 30f04a5a96 Fixed #8195 (False positive uninitvar (regression) - valueflow misses variable initialization via istringstream >>) 2017-09-02 21:53:51 +02:00
Daniel Marjamäki 9c99bc43c2 ValueFlow: Skip wrong handling of lambda functions. TODO: handle lambda functions properly. 2017-08-28 22:39:12 +02:00
Daniel Marjamäki 02a1b7cd2d Fixed #7965 (valueFlowForward: Improved handling of correlated variables) 2017-08-27 19:50:44 +02:00
Daniel Marjamäki 529b255e99 ValueFlow: Better errorpath for increment/decrement 2017-08-25 23:07:26 +02:00
Daniel Marjamäki b1b8e5270a ValueFlow: Better errorpath for increment/decrement 2017-08-25 22:15:52 +02:00
Daniel Marjamäki 50636f75ba ValueFlow: Improved error path for compound assignments 2017-08-24 22:02:49 +02:00
Daniel Marjamäki f10634c021 ValueFlow: Dont try to evaluate '/=0;' 2017-08-23 17:53:05 +02:00
Daniel Marjamäki 167cfb1ac5 valueFlowForward: improve handling of compound assignments 2017-08-23 11:13:47 +02:00
Daniel Marjamäki 3abb62a6d1 Fixed #8036 (valueFlowUninit: strcpy(buf, e = str), free(e);) 2017-08-20 19:47:26 +02:00
Daniel Marjamäki e58344c2c9 Fixed compiler warning 2017-07-22 16:23:33 +02:00
Daniel Marjamäki bf5040e3d6 Fixed #7701 (ValueFlow: handle 64-bit unsigned values ) 2017-07-22 12:19:46 +02:00
Daniel Marjamäki 32fe0aba41 Fixed #8037 (ValueFlow: global variable might be modified by function call) 2017-07-09 12:50:17 +02:00
Daniel Marjamäki bce0776417 Fixed #7795 (ValueFlow: Value is not known after conditional increment ) 2017-06-01 15:16:07 +02:00
Ayaz Salikhov 28aa939d69 iwyu - include what you use 2017-05-27 04:33:47 +02:00
Daniel Marjamäki 82a372a380 Try to clarify ErrorPath texts 2017-05-20 08:47:35 +02:00
Daniel Marjamäki f92b16706c ValueFlow: Add ErrorPath info after for loop 2017-05-19 16:32:58 +02:00
Daniel Marjamäki 2bb54fef69 ValueFlow: Test ErrorPath handling 2017-05-19 14:34:59 +02:00
Daniel Marjamäki 040d2f0012 Use simplecpp lexer in test cases 2017-05-18 21:52:31 +02:00
Daniel Marjamäki 980ca39fe2 valueFlowForward: better handling of sizeof() in rhs in assignments 2017-04-29 08:25:55 +02:00
Daniel Marjamäki 89532cf8b9 Fixed #7968 (valueFlowBeforeCondition: better handling of compound assignments) 2017-04-25 20:45:02 +02:00
Daniel Marjamäki 37fd60e879 Fixed #7293 (Use of uninitialized pointer not detected (worked in 1.71)) 2017-04-24 18:27:16 +02:00
Daniel Marjamäki 8a738eefab fixed #7998 (uninitialized variable is not found when used with switch/case) 2017-04-23 18:05:14 +02:00
Daniel Marjamäki 8fe7ee1012 Fixed #7886 (ValueFlow: endless forloop 'for (i = 0, j = 0; i < sz && j < 9; i++)') 2017-03-30 22:02:36 +02:00
PKEuS 3c8f5b85ae Refactorization: Allocate Token::_values (ValueFlow information) dynamically, reducing size of each token by around 10% 2017-03-27 18:48:34 +02:00
PKEuS 97fa9e9d1b ValueFlow: Stop on inline assembly 2017-03-23 20:01:16 +01:00
Daniel Marjamäki d1c66edb03 ValueFlow: Known values in conditional code 2017-03-03 01:29:34 +01:00
Daniel Marjamäki 47d39d0a14 Revert "Fixed #7888 (1.77 false positive from knownConditionTrueFalse with sizeof(int) == sizeof(long))"
This reverts commit a762511067.
2017-01-10 13:22:48 +01:00
Daniel Marjamäki a762511067 Fixed #7888 (1.77 false positive from knownConditionTrueFalse with sizeof(int) == sizeof(long)) 2017-01-09 22:28:55 +01:00
Daniel Marjamäki b1f7e46491 Fixed #7323 (valueflow: global variables) 2017-01-09 15:53:08 +01:00
Daniel Marjamäki f40bdddbab ValueFlow: Better handling when casting calculation result 2016-12-20 23:09:50 +01:00
Daniel Marjamäki 44ccbdedec ValueFlow: Improved value for cast 2016-12-20 21:37:25 +01:00
Daniel Marjamäki 606bb78297 ValueFlow: Better handling of casts 2016-12-20 19:32:21 +01:00
Daniel Marjamäki e14e86c103 ValueFlow: only set values in conditional code in subfunctions when sure 2016-12-20 11:06:20 +01:00
Daniel Marjamäki 807b653739 ValueFlow: Fix FP in for loops when 2nd expression is 0 2016-12-20 07:54:38 +01:00
Daniel Marjamäki f1ad7368f6 ValueFlow: bool values 2016-12-19 21:21:18 +01:00
Daniel Marjamäki 17aaecbd6b ValueFlow: Improved handling of sizeof 2016-12-18 14:03:48 +01:00
Daniel Marjamäki 72e4bc9d88 ValueFlow: skip values that cause false assertion condition 2016-12-17 21:23:14 +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
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
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
Daniel Marjamäki d40f4e4a55 Fixed #7778 (valueFlowAfterAssign: alias) 2016-11-21 17:26:36 +01:00
Daniel Marjamäki 74fa69fe5e Fixed #7821 (syntax error, first token is &) 2016-11-20 17:59:50 +01:00
Frank Zingsheim c8ff96fe8f Fixed #6180 (Usage of variable after std::move or std::forward) 2016-11-20 15:14:49 +01:00
Daniel Marjamäki 5b377ea2e4 Fixed #7821 (segmentation fault, invalid last token) 2016-11-20 14:15:51 +01:00
Daniel Marjamäki e1e9eacccc ValueFlow: Added float type 2016-11-13 22:59:56 +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
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 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 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
Daniel Marjamäki 4f051bf9dd Fixed #7599 (valueFlowAST: handle && and || better) 2016-07-17 21:51:20 +02:00
Daniel Marjamäki b26dd1ccab ValueFlow: Handle enums 2016-05-07 20:18:07 +02:00
Daniel Marjamäki 1ab5805d98 Fixed #6616 (valueFlowForward: for loop, variable in 3rd expression is changed in loop body) 2016-02-08 10:43:41 +01:00
Daniel Marjamäki d5884692df Fixed #7363 (valueflowOppositeCondition - if (size1 > size2) ... else if (size1 < size2) ...) 2016-01-30 22:13:03 +01:00
Daniel Marjamäki 30f2bb7796 ValueFlow: set known value for opposite condition in else if (#5503) 2016-01-30 20:03:55 +01:00
Daniel Marjamäki b5986f6ad2 Fixed #7358 (valueflow: value is not known after conditional assignment) 2016-01-27 19:20:00 +01:00
Daniel Marjamäki 462b98afbc Fixed #7310 (ValueFlow: Value of NULL in function call) 2016-01-26 16:53:01 +01:00
Daniel Marjamäki 5c9be4a0df Fixed #7216 (ValueFlow: known value in condition) 2016-01-26 16:10:15 +01:00
Daniel Marjamäki a391bca060 Fixed #7350 (ValueFlow: Result of 'x & 0' is always 0) 2016-01-26 10:07:42 +01:00
Daniel Marjamäki a8416bfb16 Fixed #6000 (ValueFlow: conditional code in for loops) 2016-01-24 13:11:51 +01:00
Daniel Marjamäki 76cdfbf487 Fixed #6330 (valueflow: condition is always false first iteration in dowhile loop) 2016-01-24 08:57:57 +01:00
Daniel Marjamäki b9a4a950a2 Fixed #7144 (Tokenizer::isScopeNoReturn: handling '{ { throw new string(..); } }') 2016-01-18 15:39:20 +01:00
Lauri Nurmi 996c9244d8 Update copyright year to 2007-2016. 2016-01-01 15:34:45 +02:00
Daniel Marjamäki 9cb8e9a07e Revert "Fixed #3923 (valueFlowForward: assignment in if should not cause bailout for code in else)"
This reverts commit 04f9b71281.
2015-12-12 16:50:02 +01:00
Daniel Marjamäki 04f9b71281 Fixed #3923 (valueFlowForward: assignment in if should not cause bailout for code in else) 2015-12-12 15:50:33 +01:00
Daniel Marjamäki 508b06abaa Fixed #6973 (ValueFlow: dont set possible tokvalues in unreachable code) 2015-12-01 07:49:19 +01:00
Daniel Marjamäki 8fb6f33aca ValueFlow: dont set dynamic values in unreachable code (#6973) 2015-11-30 16:15:58 +01:00
Daniel Marjamäki 0f9d90d2be Changed Copyrights. Removed my name. 2015-11-18 20:04:50 +01:00
Daniel Marjamäki 04ecbba361 Fixed #7135 (ValueFlow: Wrong pointer alias set for 'p = &p[x];') 2015-11-15 23:38:23 +01:00
Daniel Marjamäki 595f1e1a27 ValueFlow: set value for char literals 2015-11-12 16:38:58 +01:00
Daniel Marjamäki 34dbc3c00c ValueFlow: Improved handling of a[i] 2015-11-12 16:14:27 +01:00
Daniel Marjamäki 4ec333dbb6 Fixed #7007 (ValueFlow: value is not known, modified by subfunction) 2015-11-12 14:59:35 +01:00
Daniel Marjamäki 37dbebb093 Fixed #7049 (valueflow: value is not known after case) 2015-11-08 14:08:47 +01:00
Daniel Marjamäki f7a7a8a95c Fixed #6934 (False positive returnLocalVariable - assigning local array to function argument) 2015-11-07 15:07:26 +01:00
Daniel Marjamäki 4b0625c570 Fixed #6239 (Possible null pointer dereference after pointer is modified by a function template) 2015-10-27 12:33:46 +01:00
Daniel Marjamäki 60f8982999 Fixed #7039 (ValueFlow: bitand calculation '16&15') 2015-10-14 10:44:04 +02:00
PKEuS 3a5cef8a7e Refactorization: Improved usage of Settings instances in test suite 2015-10-07 18:40:03 +02:00
Frank Zingsheim 3bc21b8138 Fixed #6996 (ValueFlow: known and possible values) 2015-10-04 10:33:43 +02:00
Daniel Marjamäki bd243a4748 Fixed #6903 (ValueFlow: Fix FP in ?:) 2015-09-27 13:29:28 +02:00
Daniel Marjamäki 2e78d21480 Fixed #6730 (ValueFlow: inner scope does not return (continue,throw)) 2015-08-11 11:21:03 +02:00
Daniel Marjamäki 07a064aab0 Fixed #6910 (ValueFlow: variable incremented as macro argument is not known) 2015-08-05 14:08:57 +02:00
Daniel Marjamäki 8d3f7e36e9 Fixed #6911 (valueflow: comparison of string and NULL) 2015-08-02 18:12:03 +02:00
Daniel Marjamäki 6790d91fbb Improve error messages for conditional values. make valueFlowSwitchVariable values conditional that depend on the case. Partial fix for #6884. 2015-07-29 19:54:57 +02:00
Daniel Marjamäki fc25ed8c86 Fixed #6879 (valueflow in do-while(++i)) 2015-07-29 11:55:07 +02:00
Daniel Marjamäki bf75ee9aed Fixed #6885 (valueflow ignores assignment of variable via function call) 2015-07-29 10:49:17 +02:00
Daniel Marjamäki e759710198 Fixed #6743 (valueFlowAfterCondition: wrong value when variable is changed in conditional code) 2015-07-28 08:58:05 +02:00