[llvm] r299313 - [WASM] Remove other comparison of unsigned expression >= 0.

Davide Italiano via llvm-commits llvm-commits at lists.llvm.org
Sat Apr 1 12:47:52 PDT 2017


Author: davide
Date: Sat Apr  1 14:47:52 2017
New Revision: 299313

URL: http://llvm.org/viewvc/llvm-project?rev=299313&view=rev
Log:
[WASM] Remove other comparison of unsigned expression >= 0.

This should finally fix the GCC 7 build with -Werror.

Modified:
    llvm/trunk/lib/Object/WasmObjectFile.cpp

Modified: llvm/trunk/lib/Object/WasmObjectFile.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Object/WasmObjectFile.cpp?rev=299313&r1=299312&r2=299313&view=diff
==============================================================================
--- llvm/trunk/lib/Object/WasmObjectFile.cpp (original)
+++ llvm/trunk/lib/Object/WasmObjectFile.cpp Sat Apr  1 14:47:52 2017
@@ -810,7 +810,7 @@ SubtargetFeatures WasmObjectFile::getFea
 bool WasmObjectFile::isRelocatableObject() const { return false; }
 
 const WasmSection &WasmObjectFile::getWasmSection(DataRefImpl Ref) const {
-  assert(Ref.d.a >= 0 && Ref.d.a < Sections.size());
+  assert(Ref.d.a < Sections.size());
   return Sections[Ref.d.a];
 }
 
@@ -826,8 +826,8 @@ WasmObjectFile::getWasmRelocation(const
 
 const wasm::WasmRelocation &
 WasmObjectFile::getWasmRelocation(DataRefImpl Ref) const {
-  assert(Ref.d.a >= 0 && Ref.d.a < Sections.size());
+  assert(Ref.d.a < Sections.size());
   const WasmSection& Sec = Sections[Ref.d.a];
-  assert(Ref.d.b >= 0 && Ref.d.b < Sec.Relocations.size());
+  assert(Ref.d.b < Sec.Relocations.size());
   return Sec.Relocations[Ref.d.b];
 }




More information about the llvm-commits mailing list