This is an archive of the discontinued LLVM Phabricator instance.

[AsmParser][SystemZ][z/OS] Fix hanging scenario in HLASMAsmParser class
ClosedPublic

Authored by anirudhp on Jun 24 2021, 11:33 AM.

Details

Summary
  • In the caller of the overridden parseStatement function (i.e. the AsmParser::Run()) in the case of an error and if we're not at the start of the statement, we "eat" up until the end of the current statement, so we don't have to process it again.
  • However, in the HLASMAsmParser class what's happening is that, if an error occurs at the very start of the statement (for example, you invoke the HLASMAsmParser to parse a gnu directive), we will error out, but we never really progress in terms of the next token in the statement to parse. We simply keep looping processing the same error over and over again (partly because we're at the start of the statement)
  • To remedy this, when the parseAsHLASMLabel function fails, before returning, we "eat" until the end of the statement function, so we don't process it anymore.

Diff Detail

Event Timeline

anirudhp created this revision.Jun 24 2021, 11:33 AM
anirudhp requested review of this revision.Jun 24 2021, 11:33 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 24 2021, 11:33 AM
uweigand accepted this revision.Jun 28 2021, 9:44 AM

LGTM.

This revision is now accepted and ready to land.Jun 28 2021, 9:44 AM