This is an archive of the discontinued LLVM Phabricator instance.

[flang] Fix crash on structure constructor as selector
ClosedPublic

Authored by klausler on Jun 2 2021, 5:24 PM.

Details

Summary

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.

Diff Detail

Event Timeline

klausler created this revision.Jun 2 2021, 5:24 PM
klausler requested review of this revision.Jun 2 2021, 5:24 PM
PeteSteinfeld accepted this revision.Jun 2 2021, 7:59 PM

All builds, tests, and looks good.

This revision is now accepted and ready to land.Jun 2 2021, 7:59 PM
This revision was landed with ongoing or failed builds.Jun 3 2021, 2:48 PM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptJun 3 2021, 2:48 PM