]> granicus.if.org Git - llvm/commitdiff
[WASM] Remove other comparison of unsigned expression >= 0.
authorDavide Italiano <davide@freebsd.org>
Sat, 1 Apr 2017 19:47:52 +0000 (19:47 +0000)
committerDavide Italiano <davide@freebsd.org>
Sat, 1 Apr 2017 19:47:52 +0000 (19:47 +0000)
This should finally fix the GCC 7 build with -Werror.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299313 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Object/WasmObjectFile.cpp

index ddde85941b554aed365298d29870f5508c00d1c4..fc1dca35424e375d0ddb54258540311f9b7dfc86 100644 (file)
@@ -810,7 +810,7 @@ SubtargetFeatures WasmObjectFile::getFeatures() const {
 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 RelocationRef &Ref) 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];
 }