summaryrefslogtreecommitdiff
path: root/lld/COFF/Driver.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lld/COFF/Driver.cpp')
-rw-r--r--lld/COFF/Driver.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/lld/COFF/Driver.cpp b/lld/COFF/Driver.cpp
index 1b94f10acf80..f66fe3cab5a2 100644
--- a/lld/COFF/Driver.cpp
+++ b/lld/COFF/Driver.cpp
@@ -113,9 +113,8 @@ static std::string getOutputPath(StringRef path, bool isDll, bool isDriver) {
// Returns true if S matches /crtend.?\.o$/.
static bool isCrtend(StringRef s) {
- if (!s.ends_with(".o"))
+ if (!s.consume_back(".o"))
return false;
- s = s.drop_back(2);
if (s.ends_with("crtend"))
return true;
return !s.empty() && s.drop_back().ends_with("crtend");