forked from OSchip/llvm-project
![]() `CallDescriptions` for builtin functions relaxes the match rules somewhat, so that the `CallDescription` will match for calls that have some prefix or suffix. This was achieved by doing a `StringRef::contains()`. However, this is somewhat problematic for builtins that are substrings of each other. Consider the following: `CallDescription{ builtin, "memcpy"}` will match for `__builtin_wmemcpy()` calls, which is unfortunate. This patch addresses/works around the issue by checking if the characters around the function's name are not part of the 'name' semantically. In other words, to accept a match for `"memcpy"` the call should not have alphanumeric (`[a-zA-Z]`) characters around the 'match'. So, `CallDescription{ builtin, "memcpy"}` will not match on: - `__builtin_wmemcpy: there is a `w` alphanumeric character before the match. - `__builtin_memcpyFOoBar_inline`: there is a `F` character after the match. - `__builtin_memcpyX_inline`: there is an `X` character after the match. But it will still match for: - `memcpy`: exact match - `__builtin_memcpy`: there is an _ before the match - `__builtin_memcpy_inline`: there is an _ after the match - `memcpy_inline_builtinFooBar`: there is an _ after the match Reviewed By: NoQ Differential Revision: https://reviews.llvm.org/D118388 |
||
---|---|---|
.. | ||
APSIntType.cpp | ||
AnalysisManager.cpp | ||
AnalyzerOptions.cpp | ||
BasicValueFactory.cpp | ||
BlockCounter.cpp | ||
BugReporter.cpp | ||
BugReporterVisitors.cpp | ||
CMakeLists.txt | ||
CallDescription.cpp | ||
CallEvent.cpp | ||
Checker.cpp | ||
CheckerContext.cpp | ||
CheckerHelpers.cpp | ||
CheckerManager.cpp | ||
CheckerRegistryData.cpp | ||
CommonBugCategories.cpp | ||
ConstraintManager.cpp | ||
CoreEngine.cpp | ||
DynamicExtent.cpp | ||
DynamicType.cpp | ||
Environment.cpp | ||
ExplodedGraph.cpp | ||
ExprEngine.cpp | ||
ExprEngineC.cpp | ||
ExprEngineCXX.cpp | ||
ExprEngineCallAndReturn.cpp | ||
ExprEngineObjC.cpp | ||
FunctionSummary.cpp | ||
HTMLDiagnostics.cpp | ||
LoopUnrolling.cpp | ||
LoopWidening.cpp | ||
MemRegion.cpp | ||
PlistDiagnostics.cpp | ||
PrettyStackTraceLocationContext.h | ||
ProgramState.cpp | ||
RangeConstraintManager.cpp | ||
RangedConstraintManager.cpp | ||
RegionStore.cpp | ||
SMTConstraintManager.cpp | ||
SValBuilder.cpp | ||
SVals.cpp | ||
SarifDiagnostics.cpp | ||
SimpleConstraintManager.cpp | ||
SimpleSValBuilder.cpp | ||
Store.cpp | ||
SymbolManager.cpp | ||
TextDiagnostics.cpp | ||
WorkList.cpp |