[lld] r273157 - Don't go on an infinite loop on a missing ";".
Rafael Espindola via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 20 07:02:22 PDT 2016
Author: rafael
Date: Mon Jun 20 09:02:22 2016
New Revision: 273157
URL: http://llvm.org/viewvc/llvm-project?rev=273157&view=rev
Log:
Don't go on an infinite loop on a missing ";".
Thanks to Will Dietz for reporting the issue.
Added:
lld/trunk/test/ELF/Inputs/version-script-err.script
lld/trunk/test/ELF/version-script-err.s
Modified:
lld/trunk/ELF/SymbolListFile.cpp
Modified: lld/trunk/ELF/SymbolListFile.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/SymbolListFile.cpp?rev=273157&r1=273156&r2=273157&view=diff
==============================================================================
--- lld/trunk/ELF/SymbolListFile.cpp (original)
+++ lld/trunk/ELF/SymbolListFile.cpp Mon Jun 20 09:02:22 2016
@@ -115,7 +115,7 @@ void VersionScriptParser::parseVersionSy
for (;;) {
StringRef Cur = peek();
- if (Cur == "}" || Cur == "local:")
+ if (Cur == "}" || Cur == "local:" || Error)
return;
next();
Globals->push_back(Cur);
Added: lld/trunk/test/ELF/Inputs/version-script-err.script
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/Inputs/version-script-err.script?rev=273157&view=auto
==============================================================================
--- lld/trunk/test/ELF/Inputs/version-script-err.script (added)
+++ lld/trunk/test/ELF/Inputs/version-script-err.script Mon Jun 20 09:02:22 2016
@@ -0,0 +1,4 @@
+{
+ global:
+ foo
+};
Added: lld/trunk/test/ELF/version-script-err.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/version-script-err.s?rev=273157&view=auto
==============================================================================
--- lld/trunk/test/ELF/version-script-err.s (added)
+++ lld/trunk/test/ELF/version-script-err.s Mon Jun 20 09:02:22 2016
@@ -0,0 +1,5 @@
+// REQUIRES: x86
+
+// RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o
+// RUN: not ld.lld -shared %t.o -o %t.so --version-script %p/Inputs/version-script-err.script 2>&1 | FileCheck %s
+// CHECK: ; expected, but got }
More information about the llvm-commits
mailing list