cppcheck/test
rebnridgway 42a65c5160 Fix crash bug #8579 (#1238)
* Added declaration for deletePrevious function

* Added definition for deletePrevious function

* Fixed crash from deleteThis invalidating pointers

The crash was caused by deleteThis() invalidating the pointer to a constant variable usage.  This happened when a usage followed an assignment.  This fixes bug #8579.

* Added tokensFront to match tokensBack

This means deletePrevious can set the list's front if necessary.

* Initialised tokensFront in appropriate places

* Switched to using default Token constructor

* Switched to using Token default constructor

* Switched to using default constructor for Token

* Added missing argument to Token constructor

* Changed to use default constructor for Tokens

* Switched to using default constructor for Tokens

* Switched to using default constructor for Token

* Added new test for deleting front Token

Also made sure to use the correct constructor for Token in other tests.

* Syntax error

* Replaced tokensFront and tokensBack with a struct

This decreases the size of the Token class for performance purposes.

* Replaced tokensFront and tokensBack with a struct

* Added tokensFrontBack to destructor

* Reworked to use TokensBackFront struct

Also ran astyle.

* Reworked to use TokenList's TokensFrontBack member

* Reworked to use TokensFrontBack struct

* Reworked to use TokensFrontBack struct

* Reworked to work with TokensFrontBack struct

* Removed unnecessary scope operator

* Added missing parentheses

* Fixed syntax error

* Removed unnecessary constructor

* Default constructor now 0-initialises everything

This is safer for not using a temporary TokensFrontBack object, and doesn't use delegating constructors which aren't supported yet.

* Fixed unsafe null check

* Added missing explicit keyword

* Fixing stylistic nits

Removed default constructor as it has been superseded by the single-argument constructor with a default argument value.
Renamed listEnds to tokensFrontBack.
Fixed if statement that was supposed to be adding safety but would actually cause a crash if tokensFrontBack was null.

* Fixing stylistic nits

Removed default constructor and replaced it with a single-argument constructor with a default value.

* Fixing stylistic nits

Renamed _listEnds to _tokensFrontBack.

* Fixing stylistic nits

Renamed _listEnds to _tokensFrontBack.
2018-05-25 07:15:05 +02:00
..
cfg windows.cfg: Add macros SUCCEEDED() and FAILED(). (#1264) 2018-05-24 14:52:32 +02:00
synthetic Improve Python code 2017-06-05 13:23:00 +02:00
CMakeLists.txt Fixed #7660 (cmake build does not handle simplecpp) 2016-08-06 18:21:54 +02:00
options.cpp Updated copyright year 2018-01-14 15:37:52 +01:00
options.h Updated copyright year 2018-01-14 15:37:52 +01:00
redirect.h Updated copyright year 2018-01-14 15:37:52 +01:00
test.cxx test: tabs to spaces, remove trailing spaces and extra empty lines at the end of files 2012-09-17 13:51:40 +02:00
test64bit.cpp Fix override warnings. (#1234) 2018-05-15 16:37:40 +02:00
testassert.cpp Fix override warnings. (#1234) 2018-05-15 16:37:40 +02:00
testastutils.cpp Fix override warnings. (#1234) 2018-05-15 16:37:40 +02:00
testautovariables.cpp Fix override warnings. (#1234) 2018-05-15 16:37:40 +02:00
testbool.cpp Fix override warnings. (#1234) 2018-05-15 16:37:40 +02:00
testboost.cpp Fix override warnings. (#1234) 2018-05-15 16:37:40 +02:00
testbufferoverrun.cpp Fix crash bug #8579 (#1238) 2018-05-25 07:15:05 +02:00
testcharvar.cpp Fix override warnings. (#1234) 2018-05-15 16:37:40 +02:00
testclass.cpp Fix override warnings. (#1234) 2018-05-15 16:37:40 +02:00
testcmdlineparser.cpp Fix override warnings. (#1234) 2018-05-15 16:37:40 +02:00
testcondition.cpp Fix override warnings. (#1234) 2018-05-15 16:37:40 +02:00
testconstructors.cpp Fixed #8258 (Incorrect diagnostics when using delegating consturctor with default values) (#1255) 2018-05-22 06:42:37 +02:00
testcppcheck.cpp Fix override warnings. (#1234) 2018-05-15 16:37:40 +02:00
testerrorlogger.cpp Fix override warnings. (#1234) 2018-05-15 16:37:40 +02:00
testexceptionsafety.cpp Fix override warnings. (#1234) 2018-05-15 16:37:40 +02:00
testfilelister.cpp Fix override warnings. (#1234) 2018-05-15 16:37:40 +02:00
testfiles.pri testrunner: Add testplatform to verify platform loading (#1176) 2018-04-18 16:12:35 +02:00
testfunctions.cpp Fix override warnings. (#1234) 2018-05-15 16:37:40 +02:00
testgarbage.cpp Fix override warnings. (#1234) 2018-05-15 16:37:40 +02:00
testimportproject.cpp Fix override warnings. (#1234) 2018-05-15 16:37:40 +02:00
testincompletestatement.cpp Fix override warnings. (#1234) 2018-05-15 16:37:40 +02:00
testinternal.cpp Fix override warnings. (#1234) 2018-05-15 16:37:40 +02:00
testio.cpp Fix override warnings. (#1234) 2018-05-15 16:37:40 +02:00
testleakautovar.cpp Fixed #8262: false positive memleak (`shared_ptr` in function argument) (#1249) 2018-05-22 09:08:23 +02:00
testlibrary.cpp Fix override warnings. (#1234) 2018-05-15 16:37:40 +02:00
testmathlib.cpp Fix override warnings. (#1234) 2018-05-15 16:37:40 +02:00
testmemleak.cpp Fix override warnings. (#1234) 2018-05-15 16:37:40 +02:00
testnullpointer.cpp Fix override warnings. (#1234) 2018-05-15 16:37:40 +02:00
testoptions.cpp Fix override warnings. (#1234) 2018-05-15 16:37:40 +02:00
testother.cpp Fix override warnings. (#1234) 2018-05-15 16:37:40 +02:00
testpath.cpp Fix override warnings. (#1234) 2018-05-15 16:37:40 +02:00
testpathmatch.cpp Fix override warnings. (#1234) 2018-05-15 16:37:40 +02:00
testplatform.cpp Fix override warnings. (#1234) 2018-05-15 16:37:40 +02:00
testpostfixoperator.cpp Fix override warnings. (#1234) 2018-05-15 16:37:40 +02:00
testpreprocessor.cpp Fix override warnings. (#1234) 2018-05-15 16:37:40 +02:00
testrunner.cpp Updated copyright year 2018-01-14 15:37:52 +01:00
testrunner.vcxproj Visual Studio: testrunner: Add missing testastutils (#1186) 2018-04-23 20:03:06 +02:00
testrunner.vcxproj.filters Visual Studio: testrunner: Add missing testastutils (#1186) 2018-04-23 20:03:06 +02:00
testsamples.cpp Fix override warnings. (#1234) 2018-05-15 16:37:40 +02:00
testsimplifytemplate.cpp Fix template instantialion failure for qualified template type. (#1237) 2018-05-16 15:24:23 +02:00
testsimplifytokens.cpp Fix crash bug #8579 (#1238) 2018-05-25 07:15:05 +02:00
testsimplifytypedef.cpp Fixed #7406 (Tokenizer::simplifyTypedef: array typedef used as template parameter) (#1257) 2018-05-22 17:31:58 +02:00
testsizeof.cpp Fix override warnings. (#1234) 2018-05-15 16:37:40 +02:00
teststl.cpp Fix override warnings. (#1234) 2018-05-15 16:37:40 +02:00
teststring.cpp Fix override warnings. (#1234) 2018-05-15 16:37:40 +02:00
testsuite.cpp Fix sorting order for test fixtures to get consistent behaviour across different platforms (#1145) 2018-04-04 20:51:47 +02:00
testsuite.h Fix override warnings. (#1234) 2018-05-15 16:37:40 +02:00
testsuppressions.cpp Fix override warnings. (#1234) 2018-05-15 16:37:40 +02:00
testsymboldatabase.cpp Fix DACA2 SymbolDatabase bailout; unhandled code for final class (#1253) 2018-05-21 21:23:21 +02:00
testthreadexecutor.cpp Fix override warnings. (#1234) 2018-05-15 16:37:40 +02:00
testtimer.cpp Fix override warnings. (#1234) 2018-05-15 16:37:40 +02:00
testtoken.cpp Fix crash bug #8579 (#1238) 2018-05-25 07:15:05 +02:00
testtokenize.cpp windows.cfg: Improved support for more types. 2018-05-16 16:26:40 +02:00
testtokenlist.cpp Fix override warnings. (#1234) 2018-05-15 16:37:40 +02:00
testtype.cpp Fix override warnings. (#1234) 2018-05-15 16:37:40 +02:00
testuninitvar.cpp Fix override warnings. (#1234) 2018-05-15 16:37:40 +02:00
testunusedfunctions.cpp Fix override warnings. (#1234) 2018-05-15 16:37:40 +02:00
testunusedprivfunc.cpp Fix override warnings. (#1234) 2018-05-15 16:37:40 +02:00
testunusedvar.cpp Fix override warnings. (#1234) 2018-05-15 16:37:40 +02:00
testutils.h Fix override warnings. (#1234) 2018-05-15 16:37:40 +02:00
testvaarg.cpp Fix override warnings. (#1234) 2018-05-15 16:37:40 +02:00
testvalueflow.cpp Fix override warnings. (#1234) 2018-05-15 16:37:40 +02:00
testvarid.cpp Fix override warnings. (#1234) 2018-05-15 16:37:40 +02:00