aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Object/WasmObjectFile.cpp
diff options
context:
space:
mode:
authorHeejin Ahn <aheejin@gmail.com>2021-06-18 14:41:01 -0700
committerHeejin Ahn <aheejin@gmail.com>2021-06-21 21:22:39 -0700
commit1c7b84108861ac92fb353891e7e4c747b6ea9f28 (patch)
tree1421f7904d96d59d8e032dc2fa4208555ed2f792 /llvm/lib/Object/WasmObjectFile.cpp
parentbff2b9adbc8de23aeaa654c5957624078ddf8fe9 (diff)
downloadllvm-1c7b84108861ac92fb353891e7e4c747b6ea9f28.zip
llvm-1c7b84108861ac92fb353891e7e4c747b6ea9f28.tar.gz
llvm-1c7b84108861ac92fb353891e7e4c747b6ea9f28.tar.bz2
[WebAssembly] Make tag attribute's encoding uint8
This changes the encoding of the `attribute` field, which currently only contains the value `0` denoting this tag is for an exception, from `varuint32` to `uint8`. This field is effectively unused at the moment and reserved for future use, and it is not likely to need `varuint32` even in future. See https://github.com/WebAssembly/exception-handling/pull/162. This does not change any encoded binaries because `0` is encoded in the same way both in `varuint32` and `uint8`. Reviewed By: tlively Differential Revision: https://reviews.llvm.org/D104571
Diffstat (limited to 'llvm/lib/Object/WasmObjectFile.cpp')
-rw-r--r--llvm/lib/Object/WasmObjectFile.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Object/WasmObjectFile.cpp b/llvm/lib/Object/WasmObjectFile.cpp
index 0f4eaa1..5188037 100644
--- a/llvm/lib/Object/WasmObjectFile.cpp
+++ b/llvm/lib/Object/WasmObjectFile.cpp
@@ -1066,7 +1066,7 @@ Error WasmObjectFile::parseImportSection(ReadContext &Ctx) {
}
case wasm::WASM_EXTERNAL_TAG:
NumImportedTags++;
- Im.Tag.Attribute = readVarint32(Ctx);
+ Im.Tag.Attribute = readUint8(Ctx);
Im.Tag.SigIndex = readVarint32(Ctx);
break;
default:
@@ -1143,7 +1143,7 @@ Error WasmObjectFile::parseTagSection(ReadContext &Ctx) {
while (Count--) {
wasm::WasmTag Tag;
Tag.Index = NumImportedTags + Tags.size();
- Tag.Type.Attribute = readVaruint32(Ctx);
+ Tag.Type.Attribute = readUint8(Ctx);
Tag.Type.SigIndex = readVaruint32(Ctx);
Tags.push_back(Tag);
}