When an empty comment is present in an assembly file, the compiler will crash because it checks the first character for '\n' or '\r'.
The fix consists of also checking if the string is empty before accessing the *front* method of the StringRef.
A test is included for the x86 target, but this issue is reproducible with other targets as well.
Details
Details
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
Comment Actions
"AsmParser::parseStatement" also has this issue. Please add the fix there as part of your commit as well?
Modulo that, LGTM.
lib/MC/MCParser/AsmParser.cpp | ||
---|---|---|
703 | Nit: Please use !getTok().getString().empty() |
Comment Actions
Looks good. Do you have commit access or would you like someone to commit this patch for you?
Comment Actions
Thank you for the review.
I do not have commit access; I would appreciate it if someone can commit this.
Nit: Please use !getTok().getString().empty()