[WebAssembly] Encode numbers in ULEB128 in event section
authorHeejin Ahn <aheejin@gmail.com>
Tue, 30 Mar 2021 19:57:20 +0000 (12:57 -0700)
committerHeejin Ahn <aheejin@gmail.com>
Tue, 30 Mar 2021 23:21:58 +0000 (16:21 -0700)
commit144ec1c38ef1d3a6d37dadf7240ef5f04c10daae
treecf4d5060fda5185329a0ad137d76f3e5fcb91951
parentc5f174905b73620cf8690dbe68ea05b29d09f4a1
[WebAssembly] Encode numbers in ULEB128 in event section

The number of events and the type index should be encoded in ULEB128,
but they were incorrctly encoded in LEB128. The smallest number with
which its LEB128 and ULEB128 encodings are different is 64.
There's no way we can generate 64 events in the C++ toolchain
implementation so we can't test that, but the attached test tests when
the type index is 64.

Reviewed By: dschuff

Differential Revision: https://reviews.llvm.org/D99627
llvm/lib/Object/WasmObjectFile.cpp
llvm/test/MC/WebAssembly/event-section-encoding.ll [new file with mode: 0644]