From: Derek Schuff Date: Mon, 17 Apr 2017 20:28:28 +0000 (+0000) Subject: [WebAssembly] Encode block signatures as SLEB instead of ULEB X-Git-Tag: llvmorg-5.0.0-rc1~7519 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f7a4f3dd95b907b693a986cb0cf076fa1e93e276;p=platform%2Fupstream%2Fllvm.git [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 llvm-svn: 300490 --- diff --git a/llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyMCCodeEmitter.cpp b/llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyMCCodeEmitter.cpp index a0b0089..544cd65 100644 --- a/llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyMCCodeEmitter.cpp +++ b/llvm/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); }