Commit Graph

433 Commits

Author SHA1 Message Date
Dmitry-Me 5040491ee6 Size computation code not required outside this translation unit 2017-10-19 19:01:41 +03:00
Dmitry-Me 606e28a3c5 Extract and reuse size computation 2017-10-19 00:25:21 +03:00
Dmitry-Me 34a8d2431f Extract and reuse size computation 2017-10-19 00:20:04 +03:00
Dmitry-Me 8709490903 Clarify expressions with parentheses 2017-10-18 23:40:43 +03:00
Dmitry-Me e356ccca22 Revert "Clarify expression with parentheses"
This reverts commit bbf0a81c2d.
2017-10-18 23:31:44 +03:00
Dmitry-Me bbf0a81c2d Clarify expression with parentheses 2017-10-18 23:24:31 +03:00
Dmitry-Me 151ace2581 Use Platform for char limits computation (#972) 2017-10-18 17:30:47 +02:00
Daniel Marjamäki ad1749738e Fixed #6153 (ValueFlowBeforeCondition: Handle global variables) 2017-10-17 16:55:37 +02:00
Daniel Marjamäki 6d59290858 Fixed #10 (ValueFlow: condition variable has known value in switch case) 2017-10-16 21:51:30 +02:00
Daniel Marjamäki fbccb3ae55 Add errorpath for accessMoved message 2017-10-10 15:49:15 +02:00
Daniel Marjamäki d3c9d06aa4 astyle formatting
[ci skip]
2017-10-08 14:16:45 +02:00
Ayaz Salikhov be2c65eb58 Simplify int vs bool 2017-10-08 07:54:39 +02:00
Daniel Marjamäki 2a6fbe2e3c astyle formatting
[ci skip]
2017-10-05 23:01:42 +02:00
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