================
@@ -38,21 +61,84 @@ void UseAfterLifetimeEnd::checkEndFunction(const ReturnStmt 
*RS,
   if (ExplodedNode *N =
           C.generateNonFatalErrorNode(State, C.getPredecessor())) {
     for (const MemRegion *R : RetValRegion)
-      reportDanglingSource(R, N, C);
+      reportDanglingSource(R, RetVal, N, C);
   }
 }
 
+static SourceRange getRegionDeclRange(const MemRegion *Source) {
+  if (const auto *VR = dyn_cast<VarRegion>(Source))
----------------
isuckatcs wrote:

What if `Source` is `nullptr`?

```suggestion
  if (const auto *VR = dyn_cast_or_null<VarRegion>(Source))
```

https://github.com/llvm/llvm-project/pull/207052
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to