Commit Graph

459 Commits

Author SHA1 Message Date
Daniel Marjamäki 795b9f5e0f astyle formatting 2018-04-08 09:25:59 +02:00
Paul Fultz II aed84abfd5 Extend valueflow comparison ops (#1153)
* Handle else clause when doing a compare

* Break early

* Fix bug in checking no return else

* Escape quotes

* Add equal sign

* Simplify the logic
2018-04-08 09:24:01 +02:00
Matthias Krüger 5a104cab6e remove weird "#line 2" from valueflow.cpp 2018-04-06 23:26:08 +02:00
Daniel Marjamäki 3ad6c7ebce Refactoring, use early continue 2018-04-05 08:21:43 +02:00
Paul Fultz II b871c85b67 Improve valeflow analysis with comparison operators (#1131)
* Improve valeflow analysis with comparison operators

* Use simple match

* Dont add 0 on comparisons

* Check reverse comparisons

* Use nullptr

* Remove duplicate code tests
2018-04-05 06:51:31 +02:00
jrp2014 b6504c70ca Improve constness 2018-04-04 21:51:31 +02:00
IOBYTE 5bc039b7da Fix #6367 and #8439 (improve sizeof value flow support) (#1132) 2018-03-23 08:28:12 +01:00
Daniel Marjamäki 7699f6432b Fixed #8288 (valueFlowGlobalVar: compound assignments) 2018-03-18 19:53:33 +01:00
Daniel Marjamäki ec6133aea2 Fixed #8182 (False positive uninitvar - variable initialized in function in ternary expression) 2018-03-16 19:13:48 +01:00
Daniel Marjamäki 1628405869 Fix internal warning 2018-02-24 22:35:37 +01:00
Daniel Marjamäki 7701e4594a ValueFlowBeforeCondition: Fix wrong value in do-while condition when there is a break in the loop body 2018-02-24 22:07:34 +01:00
Daniel Marjamäki 69b50b274c Try to make Travis happy 2018-02-11 22:54:14 +01:00
Daniel Marjamäki e62b9bdc77 Fixed #8348 (ValueFlow: wrong Uninit value with abort() in else-branch) 2018-02-11 22:14:44 +01:00
Matthias Krüger f009cfc845 fix some typos found by codespell. 2018-02-04 20:53:43 +01:00
Daniel Marjamäki c4caee6b18 Updated copyright year 2018-01-14 15:37:52 +01:00
Daniel Marjamäki 6fd157e93b ValueFlow: Template arguments have 'possible' values 2018-01-11 14:22:27 +01:00
PKEuS c8010fdf42 Fixed crash on garbage code (#8307) 2018-01-07 13:11:56 +01:00
Daniel Marjamäki 8fe4852b98 Refactoring, reuse and improve isVariableChangedByFunction() 2017-11-18 11:02:52 +01:00
Daniel Marjamäki 9191e6f112 Fixed #8246 (ValueFlow: known value, function pointer argument) 2017-11-17 23:04:54 +01:00
Daniel Marjamäki 4a9984d73b Fixed #8233 (FP uninitvar found in bash:lib/readline/display.c) 2017-11-06 10:28:07 +01:00
Ayaz Salikhov 19af9bc216 Fix UB when converting float to int (#984) 2017-11-03 14:05:23 +01:00
Daniel Marjamäki 002f6679d5 Fix syntax error 2017-10-21 22:17:07 +02:00
Daniel Marjamäki c4c76aa1ad Use MathLib::bigint_bits 2017-10-21 22:08:34 +02:00
Ayaz Salikhov 64e61d28ba Add an ability to use address sanitizer (#979) 2017-10-21 21:04:14 +02:00
Daniel Marjamäki 05e1e5e0a0 astyle formatting
[ci skip]
2017-10-20 22:11:12 +02:00
Daniel Marjamäki 1d5e3e4f0c Fixed #8247 (False positive knownConditionTrueFalse) 2017-10-20 17:31:58 +02:00
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