[PATCH] D79282: [flang] Fixed a crash
Pete Steinfeld via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon May 4 08:00:20 PDT 2020
This revision was automatically updated to reflect the committed changes.
Closed by commit rGb6f1bad630fa: [flang] Fixed a crash (authored by PeteSteinfeld).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D79282/new/
https://reviews.llvm.org/D79282
Files:
flang/lib/Semantics/type.cpp
flang/test/Semantics/resolve33.f90
Index: flang/test/Semantics/resolve33.f90
===================================================================
--- flang/test/Semantics/resolve33.f90
+++ flang/test/Semantics/resolve33.f90
@@ -30,4 +30,11 @@
!ERROR: Type parameter, component, or procedure binding 'a' already defined in this type
integer, len :: a
end type
+ !ERROR: No definition found for type parameter 'k'
+ !ERROR: No definition found for type parameter 'l'
+ type :: t6(k, l)
+ !ERROR: Must be a constant value
+ character(kind=k, len=l) :: d3
+ end type
+ type(t6(2, 10)) :: x3
end module
Index: flang/lib/Semantics/type.cpp
===================================================================
--- flang/lib/Semantics/type.cpp
+++ flang/lib/Semantics/type.cpp
@@ -77,7 +77,9 @@
name = *nextNameIter++;
auto it{std::find_if(parameterDecls.begin(), parameterDecls.end(),
[&](const Symbol &symbol) { return symbol.name() == name; })};
- CHECK(it != parameterDecls.end());
+ if (it == parameterDecls.end()) {
+ break;
+ }
attr = it->get().get<TypeParamDetails>().attr();
} else {
messages.Say(name_,
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D79282.261823.patch
Type: text/x-patch
Size: 1159 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200504/5c1ba7bf/attachment.bin>
More information about the llvm-commits
mailing list