cppcheck/lib
rikardfalkeborn 13ffefc8b8 Valueflow: Fix right shift with more than 31 bits (#1553)
When comparing if the shift is large enough to make the result zero, use
an unsigned long long to make sure the result fits. Also, a check that
avoids setting the value if the shift is equal to or larger than the
number of bits in the operand (this is undefined behaviour). Finally,
add a check to make sure the calculated value is not too large to store.

Add test cases to cover this.

This was detected by an MSVC warning.

valueflow.cpp(1350): warning C4334: '<<' : result of 32-bit shift implicitly
                     converted to 64 bits (was 64-bit shift intended?)
2019-01-01 14:15:50 +01:00
..
CMakeLists.txt Fixed #7660 (cmake build does not handle simplecpp) 2016-08-06 18:21:54 +02:00
analyzerinfo.cpp Fix Cppcheck shadow variable warning 2018-11-03 19:41:25 +01:00
analyzerinfo.h Updated copyright year 2018-10-13 18:20:31 +02:00
astutils.cpp isConstVarExpression: Fix FPs when there is C++ cast 2019-01-01 11:34:44 +01:00
astutils.h Renamed FwdAnalysisAllPaths to FwdAnalysis 2018-12-31 18:00:47 +01:00
check.cpp Updated copyright year 2018-10-13 18:20:31 +02:00
check.h Export interfaces from cppcheck-core.dll used from testrunner. In turn remove ctu sources from testrunner which are obsolete now. 2018-12-28 23:09:44 +01:00
check64bit.cpp Rename _tokenizer, _settings, _errorLogger 2018-06-16 16:10:28 +02:00
check64bit.h Updated copyright year for modified files 2018-06-10 22:07:21 +02:00
checkassert.cpp Patch assert warning lib/checkassert.cpp (#1543) 2018-12-28 15:25:22 +01:00
checkassert.h Updated copyright year for modified files 2018-06-10 22:07:21 +02:00
checkautovariables.cpp Fix issue 8865: FP with dangling lifetime 2018-12-01 19:07:46 +01:00
checkautovariables.h Issue 6175: Check lifetime of a variables stored in containers and member variables 2018-11-21 08:43:57 +01:00
checkbool.cpp Use functions instead of comparing with enum (#1471) 2018-11-09 06:30:41 +01:00
checkbool.h Add check for return value of boolean function (#1451) 2018-11-01 11:08:16 +01:00
checkboost.cpp Rename _tokenizer, _settings, _errorLogger 2018-06-16 16:10:28 +02:00
checkboost.h Updated copyright year for modified files 2018-06-10 22:07:21 +02:00
checkbufferoverrun.cpp CTU: Refactoring 2018-12-25 21:11:23 +01:00
checkbufferoverrun.h CTU: Refactoring 2018-12-25 21:11:23 +01:00
checkclass.cpp Fixed #8817 (Change wording in performance/functionStatic) 2018-12-03 18:30:54 +01:00
checkclass.h Disabled CheckClass::checkCopyCtorAndEqOperator because of FP (#8388) 2018-09-08 09:14:02 +02:00
checkcondition.cpp Issue 8830: New check: Function argument evaluates to constant value 2018-12-17 06:04:24 +01:00
checkcondition.h Add a pass in valueflow for terminating conditions (#1323) 2018-11-07 06:49:07 +01:00
checkexceptionsafety.cpp Refactoring; Use range for loops 2018-07-14 09:49:03 +02:00
checkexceptionsafety.h Updated copyright year for modified files 2018-06-10 22:07:21 +02:00
checkfunctions.cpp Fix false positive: Invalid string argument with array (#1439) 2018-10-19 07:48:47 +02:00
checkfunctions.h #4241: Check for address of single character passed as string (#1381) 2018-10-14 18:49:34 +02:00
checkinternal.cpp Rename _tokenizer, _settings, _errorLogger 2018-06-16 16:10:28 +02:00
checkinternal.h Updated copyright year for modified files 2018-06-10 22:07:21 +02:00
checkio.cpp checkio: Add missing id "invalidScanfFormatWidth_smaller" to errorlist output (#1533) 2018-12-20 21:14:02 +01:00
checkio.h checkio: Add missing id "invalidScanfFormatWidth_smaller" to errorlist output (#1533) 2018-12-20 21:14:02 +01:00
checkleakautovar.cpp CTU: Reuse CheckNullPointer::isPointerDeRef in the nullpointer isUnsafeUsage 2018-12-29 09:26:57 +01:00
checkleakautovar.h Updated copyright year for modified files 2018-06-10 22:07:21 +02:00
checkmemoryleak.cpp Fix warnings (#1541) 2018-12-28 12:59:05 +01:00
checkmemoryleak.h CheckMemoryLeak: Cleanup the old memory leaks check 2018-12-17 18:12:50 +01:00
checknullpointer.cpp CheckNullPointer: Try to report all CTU issues not just the first found issue 2018-12-31 07:52:14 +01:00
checknullpointer.h CheckNullPointer: Add missing id 'nullPointerArithmeticRedundantCheck' to errorlist (#1535) 2018-12-29 21:34:22 +01:00
checkother.cpp Fixed #7384 (confuses syntax with variable name / "variable '(' is less than zero") 2018-12-31 18:36:06 +01:00
checkother.h Issue 8830: New check: Function argument evaluates to constant value 2018-12-17 06:04:24 +01:00
checkpostfixoperator.cpp Refactoring: Use ranged for loop 2018-07-13 16:50:12 +02:00
checkpostfixoperator.h Fix override warnings. (#1234) 2018-05-15 16:37:40 +02:00
checksizeof.cpp Use for arithOperationsOnVoidPointer messages 2018-09-26 17:58:22 +02:00
checksizeof.h Fix override warnings. (#1234) 2018-05-15 16:37:40 +02:00
checkstl.cpp CTU: Reuse CheckNullPointer::isPointerDeRef in the nullpointer isUnsafeUsage 2018-12-29 09:26:57 +01:00
checkstl.h CheckStl: Improving checking of container access out of bounds 2018-11-28 19:27:28 +01:00
checkstring.cpp Use functions instead of comparing with enum (#1471) 2018-11-09 06:30:41 +01:00
checkstring.h Fix --doc output. * must be escaped. 2018-10-11 13:59:21 +02:00
checktype.cpp Clarify warning 2018-12-23 12:42:18 +01:00
checktype.h Updated copyright year for modified files 2018-06-10 22:07:21 +02:00
checkuninitvar.cpp CheckUninitVar: Try to report all CTU issues not just the first found issue 2018-12-31 07:54:00 +01:00
checkuninitvar.h Fix warnings (#1541) 2018-12-28 12:59:05 +01:00
checkunusedfunctions.cpp CTU: Refactoring 2018-12-25 21:11:23 +01:00
checkunusedfunctions.h CTU: Refactoring 2018-12-25 21:11:23 +01:00
checkunusedvar.cpp Renamed FwdAnalysisAllPaths to FwdAnalysis 2018-12-31 18:00:47 +01:00
checkunusedvar.h CheckUnusedVar: Cleanup checker 2018-12-17 17:48:45 +01:00
checkvaarg.cpp Rename _tokenizer, _settings, _errorLogger 2018-06-16 16:10:28 +02:00
checkvaarg.h Updated copyright year for modified files 2018-06-10 22:07:21 +02:00
config.h
cppcheck.cpp Fixed #7203 (Better syntax error, handle array declaration with @) 2019-01-01 09:45:41 +01:00
cppcheck.h Ticket 7792: Suppression both exit_code and syntaxError when call cppcheck suppressions (#1345) 2018-09-08 11:09:49 +02:00
cppcheck.natvis Fixed Visual Studio Natvis file after recent refactoring (#1299) 2018-07-09 08:27:26 +02:00
cppcheck.vcxproj Add ctu sources to VS projects 2018-12-27 22:11:40 +01:00
cppcheck.vcxproj.filters Add ctu sources to VS projects 2018-12-27 22:11:40 +01:00
ctu.cpp CTU: Use column in function id 2018-12-31 10:18:28 +01:00
ctu.h CTU: more warnings 2018-12-30 18:31:37 +01:00
errorlogger.cpp Refactoring: Combine replaceStr functions 2018-12-28 13:11:54 +01:00
errorlogger.h Refactoring: Combine replaceStr functions 2018-12-28 13:11:54 +01:00
importproject.cpp Fixed #8864 (compile commands: handle define with string value) 2018-11-25 15:09:23 +01:00
importproject.h fixed issue 8661: Misleading error message when compilation database is not recognized 2018-07-25 16:26:25 +02:00
lib.pri CTU: Refactoring 2018-12-25 21:11:23 +01:00
library.cpp Library: Make loading of cfg files more robust. Saw a problem to use --library=gtk when the current folder has a folder 'gtk' 2018-12-24 08:37:33 +01:00
library.h Rename Library::isargvalid() 2018-07-15 23:05:48 +02:00
matchcompiler.h
mathlib.cpp Correct detection of Microsoft extensions in MathLib::isValidIntegerSuffix. Remove public overloaded implementation which was not used outside mathlib.cpp. (#1531) 2018-12-20 12:20:31 +01:00
mathlib.h Correct detection of Microsoft extensions in MathLib::isValidIntegerSuffix. Remove public overloaded implementation which was not used outside mathlib.cpp. (#1531) 2018-12-20 12:20:31 +01:00
path.cpp Updated copyright year for modified files 2018-06-10 22:07:21 +02:00
path.h Updated copyright year 2018-01-14 15:37:52 +01:00
pathmatch.cpp Updated copyright year 2018-10-13 18:20:31 +02:00
pathmatch.h Updated copyright year 2018-10-13 18:20:31 +02:00
pcrerules.pri
platform.cpp Updated copyright year 2018-03-31 20:59:09 +02:00
platform.h Fix Cppcheck error message 2018-10-20 15:28:34 +02:00
preprocessor.cpp Fixed handling of macros with known value defined in header file in configuration splitting (#8404) 2018-10-08 16:38:47 +02:00
preprocessor.h Renamed private member file0 2018-06-17 09:06:16 +02:00
settings.cpp Updated copyright year 2018-10-13 18:20:31 +02:00
settings.h Renamed --debug to --debug-simplified 2018-08-05 11:19:20 +02:00
standards.h Updated copyright year 2018-01-14 15:37:52 +01:00
suppressions.cpp Suppressions::NO_LINE : fixed comparisons 2018-09-23 16:50:51 +02:00
suppressions.h suppressions: Avoid duplicate comparison. 2018-10-04 17:13:11 +02:00
symboldatabase.cpp Improve trailing return type support. (#1520) 2018-12-13 06:34:10 +01:00
symboldatabase.h Improve trailing return type support. (#1520) 2018-12-13 06:34:10 +01:00
templatesimplifier.cpp template simplifier: also check if instantiated template is not specialized (#1551) 2018-12-31 21:29:53 +01:00
templatesimplifier.h template simplifier: refactor to use cached information (#1548) 2018-12-30 21:16:11 +01:00
timer.cpp Rename private member variables 2018-06-17 17:20:16 +02:00
timer.h Rename private member variables 2018-06-17 17:20:16 +02:00
token.cpp astyle formatting 2018-12-21 13:54:59 +01:00
token.h Fix warnings (#1541) 2018-12-28 12:59:05 +01:00
tokenize.cpp Fixed #7203 (Better syntax error, handle array declaration with @) 2019-01-01 09:45:41 +01:00
tokenize.h Doxygen fixes 2018-12-30 19:31:50 +01:00
tokenlist.cpp Optimization: Removed unnecessary calls to simplifyPath(). The Caller should do this, and our callers (mainly the test suite) more or less do so, as they all supply just dummy paths ("test.cpp") 2018-12-18 20:33:45 +01:00
tokenlist.h relative paths: show {code} properly when there are relative paths 2018-11-18 16:08:08 +01:00
utils.h Revert "Refactoring endsWith utility function" 2018-07-25 16:14:43 +02:00
valueflow.cpp Valueflow: Fix right shift with more than 31 bits (#1553) 2019-01-01 14:15:50 +01:00
valueflow.h ValueFlow: Use FwdAnalysisAllPaths in ValueFlow to track complex expressions 2018-12-31 17:05:46 +01:00
version.h Set version to 1.86.99/1.87 dev 2018-12-08 11:53:37 +01:00
version.rc