Page MenuHomePhabricator

[IA] Recognize hexadecimal escape sequences
ClosedPublic

Authored by void on Oct 4 2019, 1:43 PM.

Details

Summary

Implement support for hexadecimal escape sequences to match how GNU 'as'
handles them. I.e., read all hexadecimal characters and truncate to the
lower 16 bits.

Diff Detail

Repository
rL LLVM

Event Timeline

void created this revision.Oct 4 2019, 1:43 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 4 2019, 1:43 PM
jcai19 added inline comments.Oct 4 2019, 4:04 PM
llvm/test/MC/AsmParser/directive_ascii.s
46 ↗(On Diff #223283)

0x64 is smaller than 0xff. Maybe we can have a test case for values bigger than that?

void updated this revision to Diff 223338.Oct 4 2019, 4:27 PM

Adding testcase for hex over 0xFF.

jcai19 accepted this revision.Oct 4 2019, 5:29 PM

Thank you for the fix! LGTM. Please give some time to @nickdesaulniers for comments.

This revision is now accepted and ready to land.Oct 4 2019, 5:29 PM
This revision was automatically updated to reflect the committed changes.

I reverted this in r373898 since MC/AsmParser/directive_ascii.s failed on bots. I didn't look into it, but maybe it's because there's no bounds checking on the i + 1 index.

void added a comment.Oct 7 2019, 2:49 PM

I reverted this in r373898 since MC/AsmParser/directive_ascii.s failed on bots. I didn't look into it, but maybe it's because there's no bounds checking on the i + 1 index.

Doh! Asserts weren't turned on in my build tree. Fixed in D68598. Very sorry for the breakage.