Commit Graph

699 Commits

Author SHA1 Message Date
Daniel Marjamäki c4caee6b18 Updated copyright year 2018-01-14 15:37:52 +01:00
IOBYTE 03603c85cf Fixed #8331 (stack overflow: daca: firefox-58.0b14) (#1027) 2018-01-12 08:19:21 +01:00
IOBYTE cefb2131c7 Add support for simple c++ 11 type ailases like: using INT = int; (#1024)
* Add support for simple c++ 11 type ailases like: using INT = int;

Only types supported by ValueType are supported. Complex types like
function pointers are not supported. Template type aliases are not
supported.

* Fix crash when type in using type alias is simplified away.

This fixes a crash when size_t is replaced with unsigned long in: using
size_t = unsigned long; by the tokenizer.

This does not fix the problem where Tokenizer::simplifyPlatformTypes()
simplifies away size_t in other cases.  This is only a problem when the
new type is different from the platform type.
2018-01-10 22:16:18 +01:00
Iván Matellanes cfeea3d35c Fixed #7331: Detect copy and move constructors with default parameters (#1018) 2018-01-07 14:20:19 +01:00
Matthias Krüger af9b9595ce SymbolDatabase::createSymbolDatabaseFindAllScopes(): simplify match pattern. 2018-01-01 05:02:55 +01:00
Oleksandr Redko a8700f5622 Remove redundant parts of conditional expressions (#988)
All issues were found with PVS-Studio:
V560 A part of conditional expression is always true: tok. astutils.cpp 407
V560 A part of conditional expression is always true: size > 0. checkbufferoverrun.cpp 709
V547 Expression 'secondTrue' is always true. checkcondition.cpp 1013
V547 Expression 'firstTrue' is always true. checkcondition.cpp 1020
V560 A part of conditional expression is always true: !scan. checkio.cpp 1036
V560 A part of conditional expression is always true: scope->function. checknullpointer.cpp 395
V560 A part of conditional expression is always true: tok2. checkstl.cpp 268
V560 A part of conditional expression is always true: par. tokenize.cpp 9440
V547 Expression '!erased' is always true. symboldatabase.cpp 3990
2017-11-03 10:39:57 +01:00
Daniel Marjamäki afbfc914bc astyle formatting
[ci skip]
2017-10-20 01:53:20 +02:00
Sign Bit aaafa72bc8 Use a 'negative cache' for tokens / enumerator checks (#980)
Checking whether a token is an enumerator in all the available scopes
is expensive.  Once we determined that a token is not an enumerator,
skip all the expensive checks.
2017-10-18 18:01:36 +02:00
orbitcowboy f1e5f64690 wxwidgets.cfg: Added support for wxMenu:Append(). 2017-10-17 10:59:23 +02:00
Florin Iucha 6e737082da Store the defined types in a map, for faster lookup 2017-10-17 09:00:14 +02:00
IOBYTE 352fd7a381 SymbolDatabase: Add support for functions in unions. (#973) 2017-10-15 11:49:36 +02:00
Alexey Eryomenko 22483baf72 missed simplification in parsing of std function declaration resulted in (#967)
wrong type detection
2017-10-03 22:10:13 +02:00
Daniel Marjamäki aa38556e1c SymbolDatabase: Simplification of code. My assumption is that start and end of scope is never null. 2017-09-20 23:06:19 +02:00
Daniel Marjamäki 3d587d2704 Revert "Fix CID 1368511"
This reverts commit 41a79152a9.
2017-09-19 23:13:40 +02:00
Daniel Marjamäki 1a057bc23a Revert "Remove redundant safety logic (CID 1368511)"
This reverts commit d892031f28.
2017-09-19 23:13:31 +02:00
Daniel Marjamäki d892031f28 Remove redundant safety logic (CID 1368511) 2017-09-19 23:07:02 +02:00
Dmitry-Me 41a79152a9 Fix CID 1368511 2017-09-19 22:35:00 +03:00
Dmitry-Me 05d58f5c51 Unify classEnd check for scope 2017-09-19 22:13:50 +03:00
Dmitry-Me 349a28705a Clarify code with assertions 2017-09-15 01:11:27 +03:00
Dmitry-Me 0fe82335ac Remove duplicated method call 2017-09-15 00:53:44 +03:00
Dmitry-Me 37dea8a5cf Only check the value if it wasn't surely set by previous code 2017-09-12 23:20:07 +03:00
Dmitry-Me 9ff04b4df1 Resolve CID 1368512
Wrong pointer was being checked
2017-09-11 23:50:42 +03:00
Dmitry-Me 988de6422e Omit repeated computations 2017-09-11 18:36:44 +03:00
Dmitry-Me 68f6cad2aa Omit repeated search when no insertion occurs 2017-09-06 18:02:27 +03:00
Dmitry-Me 66524ef645 Clarify code using temporary 2017-09-06 18:00:23 +03:00
Dmitry-Me c29f16a306 Cache and reuse values 2017-09-04 17:55:45 +03:00
Hinterwaeldlers 8aa568f085 Corrected noexcept constructor delegating handling (#948) 2017-09-02 22:54:23 +02:00
Dmitry-Me 7bd3dc5da6 Simplify array access with references 2017-08-28 18:19:03 +03:00
Dmitry-Me 7d19d1ea2e Better use of temporary 2017-08-28 18:15:15 +03:00
Ayaz Salikhov b8cd7dbb5c Use nullptr instead of 0 or NULL (#936) 2017-08-09 20:00:26 +02:00
Daniel Marjamäki 32422c815b Fix issue found by Coverity, scope cant be null since scope is dereferenced on all paths before the while and also unconditionally inside while 2017-08-02 08:17:29 +02:00
Daniel Marjamäki 55aec0ef1b Fix issue detected by Coverity, vt2 is null checked and then dereferenced 2017-08-02 07:48:11 +02:00
Daniel Marjamäki 1758c3b4e7 Fix suspicious code found by Coverity, dont check if scope->function is null and then dereference it 2017-08-01 13:26:35 +02:00
Robert Reif 354a773bfe Fix #8020 (ValueType: no value type for iterator + constant) 2017-07-16 11:27:32 -04:00
Daniel Marjamäki fabe07ffd6 Merge pull request #924 from IOBYTE/master
Fixed #6985 (SymbolDatabase: Function pointer not set when calling bas…
2017-07-16 14:04:25 +02:00
Robert Reif b0aec042a6 Fixed #6985(SymbolDatabase: Function pointer not set when calling base class function)
Use using namespace when looking up types.
2017-07-15 19:14:15 -04:00
Daniel Marjamäki ea598d5284 refactoring, use early return 2017-07-09 13:09:36 +02:00
Daniel Marjamäki 211d8c6020 Refactoring checking for unused variables (avoid FN when not taking address) 2017-07-01 22:45:51 +02:00
Ayaz Salikhov 28aa939d69 iwyu - include what you use 2017-05-27 04:33:47 +02:00
amai 45ba1ff1e3 #8079 SymbolDatabase::createSymbolDatabaseEnums() crashes on invalid enum declaration 2017-05-25 09:50:14 +02:00
PKEuS 68d77b73da SymbolDatabase: Fixed parsing of unnamed arguments, properly detect pointers (#8052) 2017-05-07 09:03:58 +02:00
Robert Reif e2bfe1c0ec Fixed #8044: Crash below SymbolDatabase::setValueType 2017-05-01 14:12:50 -04:00
IOBYTE 8a668aa860 Add missing else that could cause an extra try scope to be added to the scope list (#8025)
Add an optional extended description…
2017-04-30 08:58:41 +02:00
Garrett Bodily ddfd4c6348 Write access type of functions and variables to xml dump 2017-04-29 07:18:16 +02:00
Robert Reif 964b744c96 Fixed #7990 (crash: SymbolDatabase::printOut()) 2017-04-29 07:02:49 +02:00
Robert Reif 78ad9825af Add support for auto variables in regular for loop. 2017-04-21 15:25:02 -04:00
Robert Reif 0ff8e49b69 Add support for auto variable initialized from function return type. 2017-04-20 15:22:57 -04:00
Robert Reif 69d18d9c29 Fix #7963: crash; Variable::setFlag ; gecko-dev , dom/canvas/WebGLTransformFeedback.cpp 2017-04-20 10:03:29 -04:00
Daniel Marjamäki 4f64e67298 Misra: Add rule 8.11 2017-04-17 07:45:27 +02:00
Daniel Marjamäki 1045ece946 dump: refactor valueType dump 2017-04-16 09:11:20 +02:00