[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
This commit is contained in:
Derek Schuff 2017-04-17 20:28:28 +00:00
parent 86321b2bc8
commit f7a4f3dd95
1 changed files with 2 additions and 0 deletions

View File

@ -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);
}