[flang-commits] [flang] f411c1d - [flang] Fix crash in semantic error recovery situation

Peter Klausler via flang-commits flang-commits at lists.llvm.org
Mon Nov 8 11:19:31 PST 2021


Author: Peter Klausler
Date: 2021-11-08T11:19:20-08:00
New Revision: f411c1dd95092139c8b992260705ac0b75c8583f

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

LOG: [flang] Fix crash in semantic error recovery situation

A CHECK() in semantics is triggering when analyzing a program
with an undefined derived type pointer because the CHECK is
expecting a new error message to have been issued in a function
but not allowing for the case that a diagnostic could have been
produced earlier.  Adjust the predicate.

Differential Revision: https://reviews.llvm.org/D113307

Added: 
    

Modified: 
    flang/lib/Semantics/expression.cpp

Removed: 
    


################################################################################
diff  --git a/flang/lib/Semantics/expression.cpp b/flang/lib/Semantics/expression.cpp
index 331b9b2cf5bc3..8ee8c9a9c9cea 100644
--- a/flang/lib/Semantics/expression.cpp
+++ b/flang/lib/Semantics/expression.cpp
@@ -1916,7 +1916,7 @@ auto ExpressionAnalyzer::AnalyzeProcedureComponentRef(
           "Base of procedure component reference is not a derived-type object"_err_en_US);
     }
   }
-  CHECK(!GetContextualMessages().empty());
+  CHECK(context_.AnyFatalError());
   return std::nullopt;
 }
 


        


More information about the flang-commits mailing list