[flang-commits] [PATCH] D152183: [flang] Fix crash from bug#63099 (gfortran/regression/oldstyle_3.f90)

Peter Klausler via Phabricator via flang-commits flang-commits at lists.llvm.org
Mon Jun 5 12:28:15 PDT 2023


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG69c625bf64f8: [flang] Fix crash from bug#63099 (gfortran/regression/oldstyle_3.f90) (authored by klausler).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D152183/new/

https://reviews.llvm.org/D152183

Files:
  flang/lib/Semantics/data-to-inits.cpp


Index: flang/lib/Semantics/data-to-inits.cpp
===================================================================
--- flang/lib/Semantics/data-to-inits.cpp
+++ flang/lib/Semantics/data-to-inits.cpp
@@ -320,9 +320,6 @@
   bool isPointer{lastSymbol && IsPointer(*lastSymbol)};
   bool isProcPointer{lastSymbol && IsProcedurePointer(*lastSymbol)};
   evaluate::FoldingContext &context{exprAnalyzer_.GetFoldingContext()};
-  auto &messages{context.messages()};
-  auto restorer{
-      messages.SetLocation(values_.LocateSource().value_or(messages.at()))};
 
   const auto DescribeElement{[&]() {
     if (auto badDesignator{
@@ -365,6 +362,9 @@
     return false;
   }
 
+  auto &messages{context.messages()};
+  auto restorer{
+      messages.SetLocation(values_.LocateSource().value_or(messages.at()))};
   const SomeExpr *expr{*values_};
   if (!expr) {
     CHECK(exprAnalyzer_.context().AnyFatalError());


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D152183.528545.patch
Type: text/x-patch
Size: 906 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/flang-commits/attachments/20230605/920823d2/attachment.bin>


More information about the flang-commits mailing list