summaryrefslogtreecommitdiffstats
path: root/lld/ELF/ScriptParser.cpp
diff options
context:
space:
mode:
authorDmitry Mikulin <dmitry.mikulin@sony.com>2017-02-07 19:50:47 +0000
committerDmitry Mikulin <dmitry.mikulin@sony.com>2017-02-07 19:50:47 +0000
commitf3965c02462e2f6f8e07823e219cc923e76e5708 (patch)
tree042bf63c02744c1043fad66c8094fbd28b2aa207 /lld/ELF/ScriptParser.cpp
parent3877f397cd1d52b5ac6fd5e7d1e208f2d2caa09e (diff)
downloadbcm5719-llvm-f3965c02462e2f6f8e07823e219cc923e76e5708.tar.gz
bcm5719-llvm-f3965c02462e2f6f8e07823e219cc923e76e5708.zip
Handle the case where 'local' is the name of a global in a version script:
{ global : local; local: *; }; llvm-svn: 294343
Diffstat (limited to 'lld/ELF/ScriptParser.cpp')
-rw-r--r--lld/ELF/ScriptParser.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/lld/ELF/ScriptParser.cpp b/lld/ELF/ScriptParser.cpp
index 79f3cd38646..474895fe133 100644
--- a/lld/ELF/ScriptParser.cpp
+++ b/lld/ELF/ScriptParser.cpp
@@ -156,11 +156,14 @@ StringRef ScriptParserBase::next() {
return Tokens[Pos++];
}
-StringRef ScriptParserBase::peek() {
- StringRef Tok = next();
- if (Error)
- return "";
- --Pos;
+StringRef ScriptParserBase::peek(unsigned N) {
+ StringRef Tok;
+ for (unsigned I = 0; I <= N; ++I) {
+ Tok = next();
+ if (Error)
+ return "";
+ }
+ Pos = Pos - N - 1;
return Tok;
}
OpenPOWER on IntegriCloud