[flang-commits] [PATCH] D103572: [flang] Fix crash on structure constructor as selector

Peter Klausler via Phabricator via flang-commits flang-commits at lists.llvm.org
Wed Jun 2 17:24:06 PDT 2021


klausler created this revision.
klausler added a reviewer: PeteSteinfeld.
klausler added a project: Flang.
Herald added a subscriber: jdoerfert.
klausler requested review of this revision.

In something like "ASSOCIATE(X=>T(1))", the "T(1)" is parsed
as a Variable because it looks like a function reference or
array reference; if it turns out to be a structure constructor,
which is something we can't know until we're able to attempt
generic interface resolution in semantics, the parse tree needs
to be fixed up by replacing the Variable with an Expr.

The compiler could already do this for putative function references
encapsulated as Exprs, so this patch moves some code around and
adds parser::Selector to the overloads of expression analysis.


https://reviews.llvm.org/D103572

Files:
  flang/include/flang/Semantics/expression.h
  flang/lib/Semantics/expression.cpp
  flang/lib/Semantics/resolve-names.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D103572.349423.patch
Type: text/x-patch
Size: 8225 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/flang-commits/attachments/20210603/9220a878/attachment-0001.bin>


More information about the flang-commits mailing list