[flang-commits] [flang] [Flang] Fix NULLIFY statement that returns too early for multiple procedure pointer objects. (PR #81164)
Daniel Chen via flang-commits
flang-commits at lists.llvm.org
Thu Feb 8 09:45:29 PST 2024
https://github.com/DanielCChen created https://github.com/llvm/llvm-project/pull/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.
>From 6172509b59edba672bc147666467317824438a0a Mon Sep 17 00:00:00 2001
From: cdchen-ca <cdchen at ca.ibm.com>
Date: Thu, 8 Feb 2024 12:43:10 -0500
Subject: [PATCH] [Flang] Fix NULLIFY statement that returns too early for
multiple procedure pointer objects.
---
flang/lib/Lower/Bridge.cpp | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
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