mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-11-23 22:00:10 +00:00
4ff836a138
In case when the prvalue is returned from the function (kind is one of `SimpleReturnedValueKind`, `CXX17ElidedCopyReturnedValueKind`), then it construction happens in context of the caller. We pass `BldrCtx` explicitly, as `currBldrCtx` will always refer to callee context. In the following example: ``` struct Result {int value; }; Result create() { return Result{10}; } int accessValue(Result r) { return r.value; } void test() { for (int i = 0; i < 2; ++i) accessValue(create()); } ``` In case when the returned object was constructed directly into the argument to a function call `accessValue(create())`, this led to inappropriate value of `blockCount` being used to locate parameter region, and as a consequence resulting object (from `create()`) was constructed into a different region, that was later read by inlined invocation of outer function (`accessValue`). This manifests itself only in case when calling block is visited more than once (loop in above example), as otherwise there is no difference in `blockCount` value between callee and caller context. This happens only in case when copy elision is disabled (before C++17). Reviewed By: NoQ Differential Revision: https://reviews.llvm.org/D132030 |
||
---|---|---|
.. | ||
AnalysisManager.cpp | ||
AnalyzerOptions.cpp | ||
APSIntType.cpp | ||
BasicValueFactory.cpp | ||
BlockCounter.cpp | ||
BugReporter.cpp | ||
BugReporterVisitors.cpp | ||
CallDescription.cpp | ||
CallEvent.cpp | ||
Checker.cpp | ||
CheckerContext.cpp | ||
CheckerHelpers.cpp | ||
CheckerManager.cpp | ||
CheckerRegistryData.cpp | ||
CMakeLists.txt | ||
CommonBugCategories.cpp | ||
ConstraintManager.cpp | ||
CoreEngine.cpp | ||
DynamicExtent.cpp | ||
DynamicType.cpp | ||
Environment.cpp | ||
ExplodedGraph.cpp | ||
ExprEngine.cpp | ||
ExprEngineC.cpp | ||
ExprEngineCallAndReturn.cpp | ||
ExprEngineCXX.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 | ||
SarifDiagnostics.cpp | ||
SimpleConstraintManager.cpp | ||
SimpleSValBuilder.cpp | ||
SMTConstraintManager.cpp | ||
Store.cpp | ||
SValBuilder.cpp | ||
SVals.cpp | ||
SymbolManager.cpp | ||
TextDiagnostics.cpp | ||
WorkList.cpp |