summaryrefslogtreecommitdiffstats
path: root/lld/ELF/ScriptParser.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lld/ELF/ScriptParser.cpp')
-rw-r--r--lld/ELF/ScriptParser.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lld/ELF/ScriptParser.cpp b/lld/ELF/ScriptParser.cpp
index 4d8787b5edd..cb8de972090 100644
--- a/lld/ELF/ScriptParser.cpp
+++ b/lld/ELF/ScriptParser.cpp
@@ -43,7 +43,7 @@ void ScriptParserBase::printErrorPos() {
void ScriptParserBase::setError(const Twine &Msg) {
if (Error)
return;
- if (Input.empty()) {
+ if (Input.empty() || Tokens.empty()) {
error(Msg);
} else {
error("line " + Twine(getPos()) + ": " + Msg);
OpenPOWER on IntegriCloud