From e39a78c95197f442977c9a6edc23405791a82c75 Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Mon, 17 Apr 2017 20:28:28 +0000 Subject: [PATCH] [WebAssembly] Encode block signatures as SLEB instead of ULEB Use SLEB (varint) for block_type immediates in accordance with the spec. Patch by Yury Delendik git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300490 91177308-0d34-0410-b5e6-96231b3b80d8 --- .../WebAssembly/MCTargetDesc/WebAssemblyMCCodeEmitter.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyMCCodeEmitter.cpp b/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyMCCodeEmitter.cpp index a0b00894749..544cd653fd7 100644 --- a/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyMCCodeEmitter.cpp +++ b/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyMCCodeEmitter.cpp @@ -94,6 +94,8 @@ void WebAssemblyMCCodeEmitter::encodeInstruction( MCFixupKind(WebAssembly::fixup_code_global_index), MI.getLoc())); ++MCNumFixups; encodeULEB128(uint64_t(MO.getImm()), OS); + } else if (Info.OperandType == WebAssembly::OPERAND_SIGNATURE) { + encodeSLEB128(int64_t(MO.getImm()), OS); } else { encodeULEB128(uint64_t(MO.getImm()), OS); } -- 2.50.1