mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-15 06:29:05 +00:00
AsmParser: Don't allow null bytes in BB labels
Since Value objects can't have null bytes in their name, we shouldn't allow them in the labels of basic blocks. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223907 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -393,7 +393,12 @@ lltok::Kind LLLexer::LexQuote() {
|
|||||||
|
|
||||||
if (CurPtr[0] == ':') {
|
if (CurPtr[0] == ':') {
|
||||||
++CurPtr;
|
++CurPtr;
|
||||||
kind = lltok::LabelStr;
|
if (StringRef(StrVal).find_first_of(0) != StringRef::npos) {
|
||||||
|
Error("Null bytes are not allowed in names");
|
||||||
|
kind = lltok::Error;
|
||||||
|
} else {
|
||||||
|
kind = lltok::LabelStr;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return kind;
|
return kind;
|
||||||
|
BIN
test/Assembler/invalid-name2.ll
Normal file
BIN
test/Assembler/invalid-name2.ll
Normal file
Binary file not shown.
Reference in New Issue
Block a user