forked from OSchip/llvm-project
[LLD][ELF] - Linkerscript: report location for the "unclosed comment in a linker script" error.
Currently we print "error: unclosed comment in a linker script", which doesn't provide information about the real error location. Fixes https://bugs.llvm.org/show_bug.cgi?id=46793. Differential revision: https://reviews.llvm.org/D84300
This commit is contained in:
parent
0e1a42efd8
commit
ae4279bd3e
|
@ -146,7 +146,7 @@ StringRef ScriptLexer::skipSpace(StringRef s) {
|
|||
if (s.startswith("/*")) {
|
||||
size_t e = s.find("*/", 2);
|
||||
if (e == StringRef::npos) {
|
||||
error("unclosed comment in a linker script");
|
||||
setError("unclosed comment in a linker script");
|
||||
return "";
|
||||
}
|
||||
s = s.substr(e + 2);
|
||||
|
|
|
@ -24,7 +24,7 @@ public:
|
|||
|
||||
void setError(const Twine &msg);
|
||||
void tokenize(MemoryBufferRef mb);
|
||||
static StringRef skipSpace(StringRef s);
|
||||
StringRef skipSpace(StringRef s);
|
||||
bool atEOF();
|
||||
StringRef next();
|
||||
StringRef peek();
|
||||
|
|
|
@ -4,4 +4,4 @@
|
|||
|
||||
SECTIONS /*
|
||||
|
||||
CHECK: error: unclosed comment in a linker script
|
||||
CHECK: error: {{.*}}diag6.test:1: unclosed comment in a linker script
|
||||
|
|
Loading…
Reference in New Issue