This is an archive of the discontinued LLVM Phabricator instance.

[flang] Substrings with lower bound greater than upper bound
ClosedPublic

Authored by PeteSteinfeld on Sep 16 2020, 2:49 PM.

Details

Summary

According to section 9.4.1, paragraph 3,
If the starting point is greater than the ending point, the substring has
length zero

But the compilers code for substring processing was failing a call to CHECK()
in this case. I fixed this by just setting the number of items in the
resulting string to 0 for this situation.

Diff Detail

Event Timeline

PeteSteinfeld created this revision.Sep 16 2020, 2:49 PM
Herald added a project: Restricted Project. · View Herald Transcript
PeteSteinfeld requested review of this revision.Sep 16 2020, 2:49 PM
PeteSteinfeld added a project: Restricted Project.Sep 16 2020, 2:50 PM
klausler accepted this revision.Sep 16 2020, 2:52 PM
This revision is now accepted and ready to land.Sep 16 2020, 2:52 PM
This revision was landed with ongoing or failed builds.Sep 16 2020, 2:57 PM
This revision was automatically updated to reflect the committed changes.