aboutsummaryrefslogtreecommitdiff
path: root/flang/lib/Lower/Mangler.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'flang/lib/Lower/Mangler.cpp')
-rw-r--r--flang/lib/Lower/Mangler.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/flang/lib/Lower/Mangler.cpp b/flang/lib/Lower/Mangler.cpp
index 1333e3fe..e1ae86a 100644
--- a/flang/lib/Lower/Mangler.cpp
+++ b/flang/lib/Lower/Mangler.cpp
@@ -224,8 +224,18 @@ std::string Fortran::lower::mangle::mangleName(
assert(paramExpr && "derived type kind param not explicit");
std::optional<int64_t> init =
Fortran::evaluate::ToInt64(paramValue->GetExplicit());
- assert(init && "derived type kind param is not constant");
- kinds.emplace_back(*init);
+ // TODO: put the assertion check back when parametrized derived types
+ // are supported:
+ // assert(init && "derived type kind param is not constant");
+ //
+ // The init parameter above will require a FoldingContext for proper
+ // expression evaluation to an integer constant, otherwise the
+ // compiler may crash here (see example in issue #127424).
+ if (!init) {
+ TODO_NOLOC("parameterized derived types");
+ } else {
+ kinds.emplace_back(*init);
+ }
}
}
return fir::NameUniquer::doType(modules, procs, blockId, symbolName, kinds);