summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--llvm/lib/MC/WasmObjectWriter.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/MC/WasmObjectWriter.cpp b/llvm/lib/MC/WasmObjectWriter.cpp
index 548d99fe4b9..159cc3b4def 100644
--- a/llvm/lib/MC/WasmObjectWriter.cpp
+++ b/llvm/lib/MC/WasmObjectWriter.cpp
@@ -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;
}
OpenPOWER on IntegriCloud