Fix signed/unsigned warning

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299194 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Simon Pilgrim 2017-03-31 10:45:35 +00:00
parent 0cd81d8a10
commit 347f8943df

View File

@ -660,7 +660,7 @@ void WasmObjectWriter::writeObject(MCAssembler &Asm,
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;
}