================
@@ -43,6 +43,14 @@ static bool isDanglingStackSource(const MemRegion *Source,
Source->getMemorySpaceAs<StackSpaceRegion>(State)) {
const StackFrame *SF = StackSpace->getStackFrame();
const StackFrame *CurrentSF = C.getStackFrame();
+
+ for (const StackFrame *DtorSF = CurrentSF; DtorSF;
+ DtorSF = DtorSF->getParent()) {
+ const auto *DDec =
dyn_cast_or_null<CXXDestructorDecl>(DtorSF->getDecl());
+ if (DDec)
+ return false;
+ }
----------------
steakhal wrote:
I think this loop deserves a comment of why we ignore the dtors.
https://github.com/llvm/llvm-project/pull/210801
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits