diff options
author | George Rimar <grimar@accesssoftek.com> | 2016-06-22 11:39:16 +0000 |
---|---|---|
committer | George Rimar <grimar@accesssoftek.com> | 2016-06-22 11:39:16 +0000 |
commit | b9f4492ef68a6719af70c2508c3f3dbfcf5ef641 (patch) | |
tree | 6b2e64fd3fdaab2f0a0e66bd69d32ec4b03402a8 /lld/ELF/ScriptParser.cpp | |
parent | 42402c9e89e419468096d329872370e79adf6114 (diff) | |
download | bcm5719-llvm-b9f4492ef68a6719af70c2508c3f3dbfcf5ef641.tar.gz bcm5719-llvm-b9f4492ef68a6719af70c2508c3f3dbfcf5ef641.zip |
[ELF] - Do not crash on unclosed quote (") in scripts.
Found that during investigation of FreeBsd scripts.
Unclosed quote just crashed lld.
llvm-svn: 273398
Diffstat (limited to 'lld/ELF/ScriptParser.cpp')
-rw-r--r-- | lld/ELF/ScriptParser.cpp | 2 |
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); |