This is an archive of the discontinued LLVM Phabricator instance.

[ms-inline asm] Add error check for `getAsInteger`
ClosedPublic

Authored by pengfei on May 29 2023, 7:50 AM.

Details

Summary

.Imm can get lexed as a real, but a real doesn't equal to .Imm, e.g.,
2.5 or .123e+8. We should report error for it rather than silently ignore.

Diff Detail

Event Timeline

pengfei created this revision.May 29 2023, 7:50 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 29 2023, 7:50 AM
Herald added a subscriber: hiraditya. · View Herald Transcript
pengfei requested review of this revision.May 29 2023, 7:50 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 29 2023, 7:50 AM
skan added a comment.May 29 2023, 5:07 PM

Add a test?

Add a test?

I don't think it's necessary to check each negative inputs, especially we don't have actual problem with this. This was just found by static analyze tool.
We even don't have a test when the functionality was introduced rG5dcb4664f276

skan accepted this revision.May 29 2023, 6:19 PM

LGTM

This revision is now accepted and ready to land.May 29 2023, 6:19 PM
This revision was automatically updated to reflect the committed changes.