Turn a no-op assignment into an assertion.
authorRui Ueyama <ruiu@google.com>
Wed, 14 Sep 2016 00:09:50 +0000 (00:09 +0000)
committerRui Ueyama <ruiu@google.com>
Wed, 14 Sep 2016 00:09:50 +0000 (00:09 +0000)
r279456 guarantees that this condition is always satisfied.

llvm-svn: 281426

lld/ELF/InputSection.cpp

index 320b8ab..3cc6ce5 100644 (file)
@@ -429,7 +429,7 @@ template <class ELFT> void InputSection<ELFT>::writeTo(uint8_t *Buf) {
 
 template <class ELFT>
 void InputSection<ELFT>::replace(InputSection<ELFT> *Other) {
-  this->Alignment = std::max(this->Alignment, Other->Alignment);
+  assert(Other->Alignment <= this->Alignment);
   Other->Repl = this->Repl;
   Other->Live = false;
 }