[flang-commits] [flang] e910f61 - [Flang][OpenMP] Fix type in getBaseObject causing crashes in certain scenarios (#95472)

via flang-commits flang-commits at lists.llvm.org
Fri Jun 14 05:35:02 PDT 2024


Author: agozillon
Date: 2024-06-14T07:34:59-05:00
New Revision: e910f61fb1810020ab68fdf6479bde03e702e013

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

LOG: [Flang][OpenMP] Fix type in getBaseObject causing crashes in certain scenarios (#95472)

This typo would unfortunately cause code like the following to ICE,
where common block symbols/names are used in a map clause:

subroutine sb()
  implicit none
  integer:: b, c
  common /var/ b, c

!$omp target map(tofrom: /var/)
   b = 1
   c = 2
!$omp end target
end subroutine

Added: 
    

Modified: 
    flang/lib/Lower/OpenMP/Clauses.cpp

Removed: 
    


################################################################################
diff  --git a/flang/lib/Lower/OpenMP/Clauses.cpp b/flang/lib/Lower/OpenMP/Clauses.cpp
index 1e3fea7c4cdc7..6bae62cd85860 100644
--- a/flang/lib/Lower/OpenMP/Clauses.cpp
+++ b/flang/lib/Lower/OpenMP/Clauses.cpp
@@ -153,7 +153,7 @@ Object makeObject(const parser::OmpObject &object,
 std::optional<Object> getBaseObject(const Object &object,
                                     semantics::SemanticsContext &semaCtx) {
   // If it's just the symbol, then there is no base.
-  if (!object.id())
+  if (!object.ref())
     return std::nullopt;
 
   auto maybeRef = evaluate::ExtractDataRef(*object.ref());


        


More information about the flang-commits mailing list