Commit Graph

420 Commits

Author SHA1 Message Date
hexcoder 051a18b120 pull request for ticket 8180 (better diagnostic output for bailouts) (#964)
* sync build instructions from readme.txt

* refactored the patch from ticket 8180. Moved logic from macros to the bailoutInternal function

* adapt to new bailout message format

* adapt to new bailout message format

* adapt to new bailout message format

* compile fix for Microsoft platform

* remove directory part from file locations in bailout message (normalize)

* remove directory part from valueflow message filter

* adapt tests to file format without directory part

* adapt tests to file format without directory part

* new line number agnostic assert_equals methods

* new line number agnostic assert_equals methods

* adapt to new method assertEqualsWithoutLineNumbers()

* adapt to new method assertEqualsWithoutLineNumbers()

* Bugfix: do not replace line number with spaces, remove it

* review changes: const char * -> std::string, size_t -> int, std::to_string() -> MathLib::toString()

* set #line at the beginning to guard against insertions from match compiler

* Bugfix: counting lines can be difficult :-) #line 1 -> #line 2

* added method stripDirectoryPart()

* added method stripDirectoryPart()

* used new method Path::stripDirectoryPart()

* new dependency path.h in lib/valueFlow.cpp

* code cleanup, removing redundant temporary objects and casts
2017-10-05 23:03:13 +02:00
Daniel Marjamäki ba8222de1c ValueFlow: Put 'inconclusive' state in the ValueKind. A value can't be both known and inconclusive. 2017-09-20 22:41:36 +02:00
Daniel Marjamäki 87c35cd60e ValueFlowForward: Refactoring handling of compound assignments 2017-09-20 11:45:28 +02:00
Daniel Marjamäki 1dbcba4dd6 Fixed #8221 (ValueFlow: value for static variable that is not written) 2017-09-15 15:58:19 +02:00
Daniel Marjamäki ef1f3fbee6 Fixed #8173 (ValueFlow: use AST when setting values in assignment RHS ((n=42) && n=='A')) 2017-09-14 22:49:47 +02:00
Dmitry-Me a4c20b3606 Break loop early 2017-09-12 07:48:06 +03:00
Dmitry-Me 4126fab1d5 Simplify code with temporary 2017-09-12 07:46:38 +03:00
Dmitry-Me caebf137bc Cache and reuse value 2017-09-12 00:21:36 +03:00
Dmitry-Me 5dba8268e7 Better variable name 2017-09-04 17:53:56 +03:00
Daniel Marjamäki a02fd54a69 ValueFlow: Avoid FPs for aliased variables 2017-09-03 23:24:55 +02:00
Dmitry-Me beba46987d Remove redundant variable 2017-09-01 18:19:25 +03:00
Dmitry-Me 2133350bf0 More useful default value 2017-09-01 18:17:40 +03:00
Dmitry-Me 4663dc205a Cache and reuse value 2017-09-01 18:16:08 +03:00
Daniel Marjamäki 59034e17f1 Refactoring, reuse code to skip lambda functions 2017-08-29 22:35:55 +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
Dmitry-Me d3d9c76f01 Fix off by one, resolve C4334 2017-08-14 18:07:36 +03:00
Ayaz Salikhov b8cd7dbb5c Use nullptr instead of 0 or NULL (#936) 2017-08-09 20:00:26 +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 6e1544bd49 ValueFlow: Use getOrdinalText() 2017-05-23 15:01:56 +02:00
orbitcowboy ba2b235e24 Fixed: warning: ‘tokvalue’ may be used uninitialized in this function [-Wuninitialized]. 2017-05-22 15:22:38 +02:00
Daniel Marjamäki 58da0df2f6 astyle formatting
[ci skip]
2017-05-20 18:52:48 +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 cd53d10970 ErrorPath: More information about assignments 2017-05-16 23:12:35 +02:00
Daniel Marjamäki c617851567 ErrorLogger: Added ErrorPath where each item has token and info 2017-05-16 22:38:13 +02:00
Daniel Marjamäki e65d6d3c67 ValueFlow: inherit Value::callstack in calculations 2017-05-16 19:43:55 +02:00
Daniel Marjamäki 8d75d1b920 Partial fix for #8028 (ValueFlow: Origin/callstack of value) 2017-05-15 20:05:11 +02:00
Daniel Marjamäki bc7799dccd Fixed #7888 (false positive from knownConditionTrueFalse with sizeof(int) == sizeof(long)) 2017-05-01 12:23:28 +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 a0a8f8ddd6 ValueFlowUninit: make it more strict 2017-04-28 13:29:09 +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 9a294496c1 ValueFlow::setTokenValue: Fix typo 2017-04-23 21:59:58 +02:00
Daniel Marjamäki a688402617 ValueFlow::setTokenValue: Don't calculate parent value for uninitialized values 2017-04-23 21:58:01 +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 ecc59859e1 Don't simplify _Bool in TokenList 2017-03-04 11:13:28 +01:00
Daniel Marjamäki d1c66edb03 ValueFlow: Known values in conditional code 2017-03-03 01:29:34 +01:00