[llvm] r299194 - Fix signed/unsigned warning
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Fri Mar 31 03:45:35 PDT 2017
Author: rksimon
Date: Fri Mar 31 05:45:35 2017
New Revision: 299194
URL: http://llvm.org/viewvc/llvm-project?rev=299194&view=rev
Log:
Fix signed/unsigned warning
Modified:
llvm/trunk/lib/MC/WasmObjectWriter.cpp
Modified: llvm/trunk/lib/MC/WasmObjectWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/WasmObjectWriter.cpp?rev=299194&r1=299193&r2=299194&view=diff
==============================================================================
--- llvm/trunk/lib/MC/WasmObjectWriter.cpp (original)
+++ llvm/trunk/lib/MC/WasmObjectWriter.cpp Fri Mar 31 05:45:35 2017
@@ -660,7 +660,7 @@ void WasmObjectWriter::writeObject(MCAss
unsigned n;
G.InitialValue = decodeSLEB128(p, &n);
G.ImportIndex = 0;
- if (n > end - p)
+ if ((ptrdiff_t)n > end - p)
report_fatal_error("global initial value must be valid SLEB128");
p += n;
}
More information about the llvm-commits
mailing list