diff options
| -rw-r--r-- | lld/ELF/ScriptLexer.cpp | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/lld/ELF/ScriptLexer.cpp b/lld/ELF/ScriptLexer.cpp index bab50c934a2..d4b1f6d99cc 100644 --- a/lld/ELF/ScriptLexer.cpp +++ b/lld/ELF/ScriptLexer.cpp @@ -281,10 +281,7 @@ static bool encloses(StringRef S, StringRef T) { MemoryBufferRef ScriptLexer::getCurrentMB() { // Find input buffer containing the current token. - assert(!MBs.empty()); - if (!Pos) - return MBs[0]; - + assert(!MBs.empty() && Pos > 0); for (MemoryBufferRef MB : MBs) if (encloses(MB.getBuffer(), Tokens[Pos - 1])) return MB; |

