[flang-commits] [flang] b081e9d - [Flang] Fix NULLIFY statement that returns too early for multiple procedure pointer objects. (#81164)

via flang-commits flang-commits at lists.llvm.org
Fri Feb 9 07:57:00 PST 2024


Author: Daniel Chen
Date: 2024-02-09T10:56:57-05:00
New Revision: b081e9d4cafe2563c513ed7b5ae3ced6d177b657

URL: https://github.com/llvm/llvm-project/commit/b081e9d4cafe2563c513ed7b5ae3ced6d177b657
DIFF: https://github.com/llvm/llvm-project/commit/b081e9d4cafe2563c513ed7b5ae3ced6d177b657.diff

LOG: [Flang] Fix NULLIFY statement that returns too early for multiple procedure pointer objects. (#81164)

The current code that handles NULLIFY statement for procedure pointer
returns after the 1st object.
This PR is to remove the `return` so it can nullify multiple procedure
pointer objects.

Added: 
    

Modified: 
    flang/lib/Lower/Bridge.cpp

Removed: 
    


################################################################################
diff  --git a/flang/lib/Lower/Bridge.cpp b/flang/lib/Lower/Bridge.cpp
index 579f94ba756841..7577c49fbbc16d 100644
--- a/flang/lib/Lower/Bridge.cpp
+++ b/flang/lib/Lower/Bridge.cpp
@@ -3115,10 +3115,10 @@ class FirConverter : public Fortran::lower::AbstractConverter {
         hlfir::Entity nullBoxProc(
             fir::factory::createNullBoxProc(*builder, loc, boxTy));
         builder->createStoreWithConvert(loc, nullBoxProc, pptr);
-        return;
+      } else {
+        fir::MutableBoxValue box = genExprMutableBox(loc, *expr);
+        fir::factory::disassociateMutableBox(*builder, loc, box);
       }
-      fir::MutableBoxValue box = genExprMutableBox(loc, *expr);
-      fir::factory::disassociateMutableBox(*builder, loc, box);
     }
   }
 


        


More information about the flang-commits mailing list