[MC, RISCV] Fixed StringRef Assertion `Index < Length && "Invalid index!"'
authorAna Pazos <apazos@codeaurora.org>
Sat, 25 Aug 2018 01:34:32 +0000 (01:34 +0000)
committerAna Pazos <apazos@codeaurora.org>
Sat, 25 Aug 2018 01:34:32 +0000 (01:34 +0000)
commit353f67a741daa97e94bd402f6394c6d89fd8a987
tree6169730fa1f4284457b6b9d5f9e92656e5547d92
parenta2e0c2462a5ed4ddabab03dfddb97efc54682bde
[MC, RISCV] Fixed StringRef Assertion `Index < Length && "Invalid index!"'

Summary:
Handle the case IDVal is an empty string.

This bug was uncovered by a LLVM MC Assembler Protocol Buffer
Fuzzer  for the RISC-V assembly language.

Reviewers: rnk

Reviewed By: rnk

Subscribers: rnk, niravd, pcc, peter.smith, asb, grosbach, llvm-commits, bcain, kito-cheng, shiva0217, rogfer01, PkmX

Differential Revision: https://reviews.llvm.org/D50808

llvm-svn: 340678
llvm/lib/MC/MCParser/AsmParser.cpp
llvm/test/Assembler/empty-string.s [new file with mode: 0644]