Commit Graph

105 Commits

Author SHA1 Message Date
Paul Fultz II fd8a7b9537
ValueFlow: Evaluate if statement for function returns () 2023-03-24 13:31:26 +01:00
chrchr-github 3db05cf3a4
Pass settings to isVariableChanged() () 2023-03-09 20:05:44 +01:00
Oliver Stöneberg b70e1d5461
avoid some unchecked pointer dereferences () 2023-03-02 22:05:41 +01:00
Oliver Stöneberg afd13ea11d
ValueFlow: some interface and namespace cleanups () 2023-01-28 10:20:47 +01:00
Daniel Marjamäki 464fbe8d53 Update copyright year 2023-01-28 10:16:34 +01:00
Oliver Stöneberg 1cfe49e340
use `const_iterator` where possible () 2022-12-30 15:13:47 +01:00
Paul Fultz II e2f398f81a
Fix 11250: FN: bufferAccessOutOfBounds (comma operator: int x = (3,4) ) ()
* Fix 11250: FN: bufferAccessOutOfBounds (comma operator: int x = (3,4) )

* Format
2022-12-13 07:52:58 +01:00
Paul Fultz II 7acbb656f3
Fix 11412: False positive: uninitvar ()
* Dont remove modified variables from dead code

* Add test for 11412

* Format
2022-12-09 07:15:47 +01:00
Paul Fultz II 0cb742701d
Fix 11415: FP containerOutOfBounds for container initialized in virtual method () 2022-12-08 20:10:58 +01:00
Oliver Stöneberg cff1cd9cda
applied clang-tidy `misc-const-correctness` fixes for POD types, iterators and references ()
* applied `misc-const-correctness` fixes for POD types and iterators

* applied `misc-const-correctness` fixes for references
2022-10-02 07:12:40 +02:00
chrchr-github 79daad8ff4
Fix FP arrayIndexOutOfBounds if string literals are assigned conditionally () 2022-09-01 22:59:46 +02:00
chrchr-github c340b6ae6c
Fix FP moduloofone with pow() () 2022-07-28 22:11:23 +02:00
chrchr-github 21d992cc00
Fix crash on Windows with -j option ()
* Fix crash on Windows with -j option

* Disable CI-cygwin workflow

* Update CI-cygwin.yml

* Update CI-cygwin.yml

* Update CI-cygwin.yml

* Try to fix Cygwin build

* Update CI-cygwin.yml

* Update CI-cygwin.yml

* Update CI-cygwin.yml

* Update CI-cygwin.yml

* Update CI-cygwin.yml

* Update CI-cygwin.yml

* Update CI-cygwin.yml

* Update CI-cygwin.yml

* Update CI-cygwin.yml

* Update CI-cygwin.yml

* Update CI-cygwin.yml

* Update CI-cygwin.yml

* Update CI-cygwin.yml

* Update CI-cygwin.yml

* Update CI-cygwin.yml

* Update CI-cygwin.yml

* Update CI-cygwin.yml

* Update CI-cygwin.yml

* Update CI-cygwin.yml

* Update CI-cygwin.yml

* Update CI-cygwin.yml

* Update CI-cygwin.yml

* Update CI-cygwin.yml

* Update CI-cygwin.yml

* Update CI-cygwin.yml

* Update CI-cygwin.yml

* Cygwin uses THREADING_MODEL_FORK

* Restore workflows

* Remove comment

* Fix dmake

* Fix  FP invalidFunctionArgStr

* Revert "Fix  FP invalidFunctionArgStr"

This reverts commit dd5d3e67c6.
2022-07-13 13:46:03 +02:00
Armin Müller 0ae9877766
Typos found by running "codespell" () 2022-07-10 22:40:05 +02:00
orbitcowboy c117f62926 Fixed zerodiv/moduloofone FNs for more math functions 2022-07-09 22:36:17 +02:00
orbitcowboy 8215521843 Fixed zerodiv/moduloofone FNs for more math functions 2022-07-09 19:59:16 +02:00
orbitcowboy ef47d34e75 Fixed zerodiv/moduloofone FNs for more math functions 2022-07-09 19:21:58 +02:00
orbitcowboy 0282c3a86e Fixed zerodiv/moduloofone FN for '1/std::expm1(0)' 2022-07-09 17:52:58 +02:00
orbitcowboy 07eeee1620 Fixed zerodiv FN for '1/std::exp2(0)' 2022-07-09 17:47:21 +02:00
orbitcowboy 048d31ec56 Fixed zerodiv FN for '1/std::erfc(42)' 2022-07-09 17:43:17 +02:00
orbitcowboy 87c1e6587a Fixed zerodiv FN for '1/std::erf(0)' 2022-07-09 17:38:28 +02:00
orbitcowboy c777cd5060 Fixed zerodiv FN for '1/std::ceil(0)' 2022-07-09 17:32:32 +02:00
orbitcowboy 41b6452604 Fixed zerodiv FN for '1/std::cbrt(0)' and added more test cases for other math functions 2022-07-09 17:28:15 +02:00
Paul Fultz II 6b72274c67
Evaluate math library functions in valueflow ()
* Evaluate math library functions in valueflow

* Format
2022-07-09 07:40:32 +02:00
Tau c17e2b9826
Correctly interpret boolean literals in `execute()` ()
* Correctly interpret boolean literals in `execute()`

* Add regeression test case for boolean literals
2022-07-08 12:39:29 +02:00
Paul Fultz II 8945c151f5
Fix 11124: FP knownConditionTrueFalse with fruit ()
* Update valueType

* Allow comparisons

* Fix compare op

* Add test

* Format

* Fix FP

* Format
2022-06-11 11:02:04 +02:00
PKEuS 1275b5275e
LCppC backport: Various optimizations ()
* Optimization: Use Token::eIncDecOp instead of expensive Token::Match calls

Merged from LCppC.

* Small Optimizations: - Moved a std::set that is only need during initialization of SymbolDatabase to function scope - Use std::vector instead of std::list

Merged from LCppC.

* Optimization: Refactorized various Token::Match calls and surrounding conditions

Merged from LCppC.

* Refactorization: Cleanup usage of std::multimap

Merged from LCppC.
2022-06-08 16:58:57 +02:00
chrchr-github 69834d537b
Fix False negative: variable is not used () 2022-06-07 21:20:33 +02:00
Paul Fultz II 5f9bee9b91
Fix 11056: FP uninitvar with known condition in loop ()
* Fix 11056: FP uninitvar with known condition in loop

* Format
2022-05-12 06:37:48 +02:00
Paul Fultz II 8d16ee946c
Fix 11027: False positive: containerOutOfBounds from condition in assert ()
* Fix 11027: False positive: containerOutOfBounds from condition in assert

* Format
2022-05-05 06:54:44 +02:00
Paul Fultz II 496b45f27b
Fix 11009: FP uninitvar ()
* Fix 11009: FP uninitvar

* Format
2022-05-04 05:59:01 +02:00
Paul Fultz II 09597bc7e8
Fix 10956: ValueFlow: Incorrect value when assigned to two variables ()
* Fix 10956: ValueFlow: Incorrect value when assigned to two variables

* Format
2022-04-14 07:35:07 +02:00
Oliver Stöneberg 45158ec064
cleaned up includes based on include-what-you-use ()
* cleaned up includes based on include-what-you-use

* updated translations
2022-04-13 12:24:00 +02:00
Paul Fultz II 4fde7f8b18
Fix 10449: Regression: knownConditionTrueFalse (strlen/wcslen) ()
* Refactor library function usage

* Evaluate library function in program memory

* Fix and add tests

* Format
2022-04-06 06:35:38 +02:00
Oliver Stöneberg 0d336b868c
avoid some Clang compiler warnings () 2022-03-13 20:07:58 +01:00
Paul Fultz II ff902369e0
Fix 10851: False positive: known variable value below for loop ()
* Fix 10851: False positive: known variable value below for loop

* Format

* Add test for 10863

* Format
2022-03-12 06:15:35 +01:00
Oliver Stöneberg 6e57cc4323
small utils.h cleanup () 2022-02-11 19:44:08 +01:00
Paul Fultz II 5d25050b06
Fix 10788: False positive: zerodivcond when using an assert () 2022-02-10 20:22:14 +01:00
Paul Fultz II f2a419653c
Refactor ProgramMemory to store the expression tokens instead of exprIds () 2022-02-06 20:15:45 +01:00
Daniel Marjamäki 3989408738 Update copyright year 2022-02-05 11:45:17 +01:00
Oliver Stöneberg 8f7770f512
added an include-what-you-use GitHub Action () 2022-02-01 17:19:19 +01:00
Oliver Stöneberg 171da2e6f9
avoid dependency on transitive includes - based on include-what-you-use () 2022-01-27 19:03:20 +01:00
Oliver Stöneberg a2a9c90142
added some missing copyright headers () 2022-01-26 19:02:20 +01:00
Oliver Stöneberg 55ff684f34
added unusedFunction self check to CI / cleanups () 2022-01-18 22:02:25 +01:00
Paul Fultz II 1682344a80
Fix 10678: FP nullPointerArithmeticRedundantCheck in while loop () 2022-01-04 21:19:45 +01:00
Paul Fultz II 73f24b43f9
Fix 10437: FP knownConditionTrueFalse after pointer check () 2021-12-20 07:28:40 +01:00
Oliver Stöneberg ba402f3e50
cleaned up includes based on include-what-you-use () 2021-12-15 19:47:27 +01:00
Paul Fultz II cb2738a60c
Fix 10645: FP knownEmptyContainer after conditional return () 2021-12-14 07:22:57 +01:00
Paul Fultz II a0d3c2c719
Handle for loop conditions in afterCondition () 2021-11-14 18:30:36 +01:00
Paul Fultz II 8c9c46835a
Fix for 6597: false negative: uninitialized variable usage not detected (ValueFlow , multi variables) () 2021-10-30 22:13:58 +02:00