[flang-commits] [flang] [flang] Don't crash in expression analysis after detecting error (PR #91234)
Peter Klausler via flang-commits
flang-commits at lists.llvm.org
Mon May 6 09:23:22 PDT 2024
https://github.com/klausler created https://github.com/llvm/llvm-project/pull/91234
Avoid calling GetArguments() if a fatal error has been detected.
Fixes https://github.com/llvm/llvm-project/issues/91114.
>From da0c9c1d28dcb28632270735dfa4c747613d317c Mon Sep 17 00:00:00 2001
From: Peter Klausler <pklausler at nvidia.com>
Date: Mon, 6 May 2024 09:14:25 -0700
Subject: [PATCH] [flang] Don't crash in expression analysis after detecting
error
Avoid calling GetArguments() if a fatal error has been detected.
Fixes https://github.com/llvm/llvm-project/issues/91114.
---
flang/lib/Semantics/expression.cpp | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/flang/lib/Semantics/expression.cpp b/flang/lib/Semantics/expression.cpp
index f677973ca2753b..e7f137232463dd 100644
--- a/flang/lib/Semantics/expression.cpp
+++ b/flang/lib/Semantics/expression.cpp
@@ -4210,7 +4210,9 @@ MaybeExpr ArgumentAnalyzer::TryDefinedOp(
if (Symbol *symbol{scope.FindSymbol(oprName)}) {
anyPossibilities = true;
parser::Name name{symbol->name(), symbol};
- result = context_.AnalyzeDefinedOp(name, GetActuals());
+ if (!fatalErrors_) {
+ result = context_.AnalyzeDefinedOp(name, GetActuals());
+ }
if (result) {
inaccessible = CheckAccessibleSymbol(scope, *symbol);
if (inaccessible) {
More information about the flang-commits
mailing list