Simon Martin
53b58f0ed9
Refactoring. Use Token::Match instead of hardcoded patterns to increase readability.
2014-09-14 11:26:16 +02:00
Daniel Marjamäki
0ab7abded1
AST: fixed cast for 'return (long long)c << 40;'
2014-09-12 06:43:52 +02:00
PKEuS
e4a81f9666
Improved checksum algorithm to fix configurations being purged by coincidence ( #6126 ):
...
- Better distribution of values by rotating the bits of the checksum for each token
2014-09-03 23:10:38 +02:00
PKEuS
bf2f76e70c
Detect and purge duplicate configurations by calculating a checksum.
2014-09-02 22:35:52 +02:00
PKEuS
80df3dc642
Disabled several checks and simplifications for C code, if they are C++-only. Do not match arguments for C code, since there can't be overloads.
2014-09-01 18:43:24 +02:00
Daniel Marjamäki
cd75b2d83d
AST: fix hang for code 'MACRO({.x=1,.y=2})'
2014-08-25 19:10:16 +02:00
Daniel Marjamäki
1060b30e52
AST: better AST for placement new expression 'new (a) MyClass;'
2014-08-23 13:21:36 +02:00
PKEuS
a1b7ab277b
Changed handling of unhandled characters:
...
- Don't abort checking (reverts 42140b6488
)
- Modified error message: New Id unhandledCharacter, removed redundant line information, improved message text
2014-08-08 09:49:09 +02:00
PKEuS
95afa51b24
Fixed crash #5991 : Don't crash when lambda is incomplete
...
Fixed crash #6004 : Support struct initializations in AST
2014-07-31 23:15:36 +02:00
Dmitry-Me
ba3757dfd3
Bring variables decalaration to where they are really needed.
2014-07-10 11:23:14 +04:00
Alexander Mai
df95cd09f0
Fix compiler warnings about type mismatch
2014-07-08 21:47:22 +02:00
amai2012
9b38ae73c1
Attempt to fix 2 Coverity messages.
...
Replace a few unsigned int by std::size_t
2014-07-07 21:25:30 +02:00
Daniel Marjamäki
72992c7973
AST: fixed ast for '++i;'
2014-06-26 17:31:57 +02:00
PKEuS
7ea7ee0005
Store Token::_originalName on heap, since it is only used for a small amount of Tokens (reduce memory usage of TokenList by ~12% (x64))
2014-06-26 11:51:02 +02:00
PKEuS
ec1bd420a7
Refactorizations optimizing std::string usage:
...
1) Added global static const std::string emptyString; object:
-> Replaces some static variables in functions which might be not threadsafe
-> Avoids constructor call (std::string::string(""))
-> Even functions that return an empty string in some branches can return by reference now.
Added to config.h to ensure that it is available everywhere
2) Added overloads for TestFixture::assertEquals for the most common use cases:
-> Moves conversion from const char[] to std::string into a function, reducing code duplication in binary.
2014-06-26 11:51:02 +02:00
PKEuS
e80104327a
AST: Fixed detection of operator new/delete - don't hang when C code is checked as C++ ( #5910 )
2014-06-26 09:19:57 +02:00
PKEuS
3a89e5d65f
Fixed cppcheck warnings introduced by previous commit
2014-06-24 19:51:47 +02:00
PKEuS
1b5d127373
Cache results for TokenList::isC() and TokenList::isCPP() to avoid redundant calls to Path::isCPP()/isC(), which perform slow string operations (conversion to lowercase, substring, comparisons)
...
-> Speedup of 2% on self-checking cppcheck-core (MSVC12, x64, not matchcompiled)
2014-06-24 17:42:39 +02:00
PKEuS
8b9daadd25
Replaced static variable isCPP in Token (was not threadsafe):
...
- Encapsulate parameters passed through AST compiler functions in a struct
-> Reduces maintenance overhead when changing them
-> Contains parameter indicating if the file is C or C++
- Added eKeyword Token type (at the moment, only true for C++ keyword "delete", but should be set for other keywords as well)
2014-06-14 10:28:12 +02:00
PKEuS
2455b76abd
Fixed lots of bugs in the AST:
...
- Support new and delete
- Properly handle "..."
- References and rValue references as function parameters
- Destructor definitions
2014-06-04 18:47:56 +02:00
PKEuS
d93d7401c6
Moved getSourceFilePath(), isC() and isCPP() from Tokenizer to TokenList
...
Conflicts:
lib/tokenize.cpp
2014-06-04 18:36:25 +02:00
Daniel Marjamäki
46bf23aa6d
TokenList: added assertion that makes sure the Preprocessor doesn't let through extended ascii wrongly.
2014-05-31 18:02:19 +02:00
PKEuS
8f083af1e4
Attempt to fix travis build
2014-05-25 22:11:56 +02:00
PKEuS
a407b55945
Added support for lambdas to AST
...
Fixed bug that return statement left an operand on the stack
2014-05-25 21:55:39 +02:00
PKEuS
55c87248ba
Fixed crash on complex cast.
2014-05-24 20:21:08 +02:00
PKEuS
38aaa46804
Stabilized AST:
...
- Fixed broken simplification causing crashs when cast was followed by unary minus (real world examples from arch/parisc/math-emu/ (linux-kernel))
- Stabilized determination of unary and binary operators
2014-05-24 19:05:04 +02:00
PKEuS
b78131cfcf
Improved cast detection in AST:
...
-> Make use of it in checkother.cpp
Use tokenizer simplification instead of reimplementation for test suite
2014-05-24 11:29:32 +02:00
Alexander Mai
be9a566d48
Refactoring/small corrections to fix warnings from clang -fsanitize=undefined 'member call on null pointer'
2014-05-20 21:55:08 +02:00
PKEuS
d1c4777053
Fixed two bugs in AST compilation ( #5830 ):
...
- Correctly parse operators .* and ->*
- Support empty branch in ternary expression (a?:c)
2014-05-19 21:54:59 +02:00
Philipp Kloke
ed7d0b321b
Bugfixes for AST and AST testing:
...
- Validate AST in test suite: Check for operand1 being set if operand2 is non-zero
- Fixed buggy unit tests in AST
- Fixed detection unary operator* after return statement (MPC-HC false positive)
2014-05-19 11:17:37 +02:00
PKEuS
683d0b7e82
Partially rewritten AST compilation:
...
- More straightforward approach for handling right-to-left associativity
- More straightforward approach to handling unary operators
- Improved handling of brackets
This fixes #5784 , #5795 , #5797 , #5799 , #5810 and a bunch of other problems
2014-05-18 12:10:39 +02:00
PKEuS
a3bb8bf39c
AST: Parse ternary and assignment operators as right-to-left and on the same precedence level
2014-05-11 17:50:58 +02:00
PKEuS
70dfb55f21
Simplified some Token::Match patterns
2014-05-11 17:50:58 +02:00
Daniel Marjamäki
9fc8bdcbac
Fixed #5770 (AST: better handling of 'a.b[c.d]==0')
2014-05-08 06:48:53 +02:00
Robert Reif
2d2847ddbd
Fixed #5764 (Store Token flags in a single variable)
2014-05-06 06:35:48 +02:00
Robert Reif
ae96491d6c
Fixed #5756 (declspec(nothrow) not supported)
2014-05-04 20:47:20 +02:00
Daniel Marjamäki
7d583e639c
AST: Fixed handling of '(((typeof(x))*)0)'
2014-05-04 18:36:04 +02:00
Daniel Marjamäki
5a23b739da
ValueFlow: Improved bailout when variable is reassigned
2014-05-03 12:49:07 +02:00
Daniel Marjamäki
4b7aaba159
AST: assignment operators are executed from right to left
2014-05-03 12:08:42 +02:00
Daniel Marjamäki
648479d909
AST: Fixed tree for 'a.b[5]'
2014-04-29 06:09:26 +02:00
Daniel Marjamäki
d279f3fb41
Fixed #5736 (AST: proper handling of 'a=(b).c;')
2014-04-27 18:03:50 +02:00
Daniel Marjamäki
9f2e37da37
AST: fixed 'a.b++' and '*c[5]--'
2014-04-27 16:02:24 +02:00
Daniel Marjamäki
11856b51aa
AST: Fixed handling of 'a=b(c**)+1'
2014-04-26 13:32:08 +02:00
Daniel Marjamäki
c34616a6ba
AST: Fixed handling of 'a = b.c[++(d.e)];'
2014-04-26 13:16:34 +02:00
Frank Zingsheim
ffa55bbaa0
Fixed #5725 (FP: multicondition Expression is always false because 'else if' in pngwrite.cxx (LibreOffice))
2014-04-26 11:59:38 +02:00
Daniel Marjamäki
8602d13dc9
Fixed #5722 (AST: wrong handling of 'x = ((a[i])->getx)();' - the 'x' is an operand of the =)
2014-04-25 06:06:54 +02:00
Daniel Marjamäki
c98beafb6d
Fixed #5675 (wrong AST generated for 'a>>=b')
2014-04-21 13:05:34 +02:00
Robert Reif
6ff5de2118
Fixed #5697 (Check for throw in __attribute__((nothrow)) function)
2014-04-20 20:40:55 +02:00
Daniel Marjamäki
5c116c622d
AST: Fixed iscast detection in '*((DWORD*)&buf[0])'
2014-04-15 15:46:26 +02:00
Daniel Marjamäki
4b6164087e
Use constant instead of magic number for AST recursion limit
...
[ci skip]
2014-04-15 06:31:09 +02:00