[flang-commits] [flang] [flang][runtime] Validate pointer DEALLOCATE (PR #78612)

Peter Klausler via flang-commits flang-commits at lists.llvm.org
Sat Jan 27 10:08:52 PST 2024


================
@@ -454,7 +454,9 @@ class AllocateStmtHelper {
                            const fir::MutableBoxValue &box) {
     if (!box.isDerived() && !errorManager.hasStatSpec() &&
         !alloc.type.IsPolymorphic() && !alloc.hasCoarraySpec() &&
-        !useAllocateRuntime) {
+        !useAllocateRuntime && !box.isPointer()) {
----------------
klausler wrote:

The bad deallocations are being caught in my testing without it, but I don't really understand the flow here.  Should I just add the check to `genDeallocate()` anyway?

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


More information about the flang-commits mailing list