Commit Graph

7998 Commits

Author SHA1 Message Date
Iván Matellanes cfeea3d35c Fixed #7331: Detect copy and move constructors with default parameters (#1018) 2018-01-07 14:20:19 +01:00
PKEuS c8010fdf42 Fixed crash on garbage code (#8307) 2018-01-07 13:11:56 +01:00
PKEuS 817f66d74d Fixed crash on garbage code (#8317) 2018-01-07 12:52:28 +01:00
Matthias Krüger eb58df236e CheckOther::accessMovedError() / accessMoved, accessForwarded warnings: put variable name into single quotes. 2018-01-07 10:57:19 +01:00
Daniel Marjamäki 83b87b54b4 Fixed #8191 (False positive iterators regression) 2018-01-06 22:25:13 +01:00
Daniel Marjamäki 61767d4932 Fixed #8125 (incorrect error iterators) 2018-01-06 16:08:12 +01:00
Daniel Marjamäki 98b45ffbc0 Fixed #8314 (TemplateSimplifer crash) 2018-01-06 15:16:03 +01:00
Daniel Marjamäki 943693acfb TemplateSimplifier: Improved code for template aliases 2018-01-06 08:40:06 +01:00
Martin Ettl 53fbfc9fdb test: Various micro optimizations: Replaced std::string() with std::string(). Use std::string::clear() instead of s = and prefer std::string::empty() instead of (s == ) for checking a string is empty. 2018-01-05 22:03:49 +01:00
Daniel Marjamäki 04c57381ea Fixed #8315 (heap use after free: templatesimplifier) 2018-01-05 16:10:13 +01:00
Daniel Marjamäki a95108ebe3 TemplateSimplifier: Fix incorrect recursion when template is reused inside itself 2018-01-03 23:05:57 +01:00
Daniel Marjamäki 255b788d4d Fixed #4903 (Improve check: allocated but not initialized (condition)) 2018-01-02 23:20:46 +01:00
Daniel Marjamäki 1af69bd0d4 Tokenizer::createLinks2: fix link for >> 2018-01-01 15:20:21 +01:00
Matthias Krüger f2b2be2166 CheckInternal::checkRedundantTokCheck(): also catch patterns of the form if(!tok || !Token::Match(tok, "foo")). 2018-01-01 05:02:41 +01:00
Daniel Marjamäki fa42a08a71 Make code less strict that looks for garbage template code. Before a template there might be unknown macros. 2017-12-31 16:25:41 +01:00
Daniel Marjamäki 7d2450e445 Fixed #1478 (false negative: buffer access out of bounds not detected after free and malloc) 2017-12-31 14:58:26 +01:00
Daniel Marjamäki f6fcf01cc6 Fixed #7868 (TemplateSimplifier: template specialization fails) 2017-12-30 22:14:48 +01:00
Daniel Marjamäki a8f73055ad Templates: Fixed scope problem 2017-12-30 09:00:19 +01:00
Daniel Marjamäki fc1ac180e6 Fixed #6218 (Template type aliasing misdetection) 2017-12-29 22:47:07 +01:00
Daniel Marjamäki 469cb7e6df TemplateSimplifier: Fix instantiations when template parameter is a template 2017-12-26 22:34:39 +01:00
baltth 6cbd69bf2d Fix define parsing from compile_command.json (#1013)
* Define value parsing from compile_commands.json

* Handle escaping in defined values

* Added test for importCompileCommands

* Added used defines for imported projects

* Fixed unnecessary string literals
2017-12-26 13:04:27 +01:00
Daniel Marjamäki 2c69f2b226 TemplateSimplifier: Improved handling of scopes 2017-12-26 10:55:18 +01:00
Daniel Marjamäki eaadfb3910 update debug token list output for templates. 2017-12-25 23:16:51 +01:00
Daniel Marjamäki a80760cb6f TemplateSimplifier: Fix in expandTemplate 2017-12-25 08:19:46 +01:00
Daniel Marjamäki 1eb2df34ad Revert improved scope handling in TemplateSimplifier 2017-12-23 22:11:30 +01:00
Daniel Marjamäki d237d36d46 TemplateSimplifier: Fix crash seen in Travis 2017-12-23 17:29:28 +01:00
Daniel Marjamäki 2d7fedbb49 Try to fix Travis 2017-12-23 15:41:32 +01:00
Daniel Marjamäki 91839c2534 Fixed #7987 (FP copyCtorAndEqOperator - class with a move constructor and move assignment operator) 2017-12-23 10:35:14 +01:00
Daniel Marjamäki 326765c632 TemplateSimplifier: Better handling of scopes 2017-12-23 08:20:24 +01:00
Daniel Marjamäki 9c17bddbd4 Tweak fix for ticket #8297 2017-12-17 22:27:05 +01:00
Daniel Marjamäki 1428759479 Fixed #8297 (Tokenizer:createLinks: 'X<sizeof(int)==1 || sizeof(int)==4>()') 2017-12-17 15:53:05 +01:00
Daniel Marjamäki d292434e76 Try again to clarify warning message for new strcmp() checker 2017-12-13 15:28:50 +01:00
Daniel Marjamäki 3f36d4b5f4 try to clarify error message 2017-12-11 22:10:00 +01:00
versat cc435c3e92 Add missing tests for strncpy
Add tests for verifying that the bufferoverrun tests are correct.
2017-12-11 10:25:59 +01:00
IOBYTE 026d8f6859 fix #8284: False positive: "Label 'class' is not used." for anonymous… (#1011)
* fix #8284: False positive: "Label 'class' is not used." for anonymous C++ class

Add support for annonymous derived structures and classes.

* Fix travis build (use findsimplematch).

* Fix bug in simplifyLabelsCaseDefault which was inserting ; in wrong place.
2017-12-05 16:50:04 +01:00
Simon Martin 1b14380007 Ticket #8175: Fix bug in TemplateSimplifier::instantiateMatch with template parameters involving sizeof or namespace. 2017-12-02 19:18:36 +01:00
BNT fd76abba16 also generate debug information when building for release. This makes (#1003)
debugging and profiling easier and has now drawback as long as the PDB
files are not distributed (which would blow up installers)
2017-11-29 08:31:30 +01:00
Daniel Marjamäki 43db6147d3 astyle formatting
[ci skip]
2017-11-27 23:32:20 +01:00
Daniel Marjamäki f28d5e91ac Fixed #8251 (Condition: bug when there are more than 2 strcmp() on same buffer (tricky)) 2017-11-27 12:55:20 +01:00
Simon Martin cbf0b13b3e Ticket #8255: Don't crash upon invalid code while checking conditions. 2017-11-25 08:22:39 +01:00
Dmitry-Me 4ac56a55be Fix FN for signed short passed as %hx into printf 2017-11-21 22:17:02 +03:00
Dmitry-Me c6bf881ee6 Fix FN for signed char passed as %hhx into printf 2017-11-21 22:14:48 +03:00
Dmitry-Me 5869f6d989 Fix FN for std::intmax_t passed as %ld, %lld into scanf 2017-11-20 23:07:37 +03:00
Dmitry-Me 7cf21f329a Fix FN for size_t, uintmax_t passed as %lx and %llx into printf 2017-11-20 22:56:33 +03:00
Dmitry-Me f0a7365f35 Fix FN for ptrdiff_t passed as %Ix into printf 2017-11-20 22:51:10 +03:00
Dmitry-Me 20eaf3fcca Tests for intmax_t passed as %ld and %lld into scanf 2017-11-20 22:34:31 +03:00
Dmitry-Me eb4bb893b3 Fix FP for std::intmax_t passed as %jd into scanf 2017-11-20 22:31:13 +03:00
Dmitry-Me 125daec71b Tests for std::intmax_t passed as %ju and %jx into scanf 2017-11-20 22:14:00 +03:00
Dmitry-Me c4b6db7e23 Fix FP for std::uintmax_t passed as %ju and %jx into scanf 2017-11-20 22:13:20 +03:00
Daniel Marjamäki 9191e6f112 Fixed #8246 (ValueFlow: known value, function pointer argument) 2017-11-17 23:04:54 +01:00