[flang-commits] [flang] [flang] Fix use-after-free cases found by valgrind (PR #122394)

Peter Klausler via flang-commits flang-commits at lists.llvm.org
Fri Jan 10 08:38:21 PST 2025


================
@@ -139,7 +139,7 @@ class Traverse {
     return visitor_(x.base());
   }
   Result operator()(const Triplet &x) const {
-    return Combine(x.lower(), x.upper(), x.stride());
+    return Combine(x.GetLower(), x.GetUpper(), x.GetStride());
----------------
klausler wrote:

The current code ends up visiting heap objects that had already been destroyed because they had been owned by local variables that had gone out of scope.

https://github.com/llvm/llvm-project/pull/122394


More information about the flang-commits mailing list