aboutsummaryrefslogtreecommitdiff
path: root/lib/Object/WasmObjectFile.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2019-10-23 17:51:42 +0000
committerDimitry Andric <dim@FreeBSD.org>2019-10-23 17:51:42 +0000
commit1d5ae1026e831016fc29fd927877c86af904481f (patch)
tree2cdfd12620fcfa5d9e4a0389f85368e8e36f63f9 /lib/Object/WasmObjectFile.cpp
parente6d1592492a3a379186bfb02bd0f4eda0669c0d5 (diff)
Notes
Diffstat (limited to 'lib/Object/WasmObjectFile.cpp')
-rw-r--r--lib/Object/WasmObjectFile.cpp13
1 files changed, 5 insertions, 8 deletions
diff --git a/lib/Object/WasmObjectFile.cpp b/lib/Object/WasmObjectFile.cpp
index 82aa1830dced..014b403556df 100644
--- a/lib/Object/WasmObjectFile.cpp
+++ b/lib/Object/WasmObjectFile.cpp
@@ -56,7 +56,7 @@ LLVM_DUMP_METHOD void WasmSymbol::dump() const { print(dbgs()); }
Expected<std::unique_ptr<WasmObjectFile>>
ObjectFile::createWasmObjectFile(MemoryBufferRef Buffer) {
Error Err = Error::success();
- auto ObjectFile = llvm::make_unique<WasmObjectFile>(Buffer, Err);
+ auto ObjectFile = std::make_unique<WasmObjectFile>(Buffer, Err);
if (Err)
return std::move(Err);
@@ -781,7 +781,7 @@ Error WasmObjectFile::parseRelocSection(StringRef Name, ReadContext &Ctx) {
break;
case wasm::R_WASM_GLOBAL_INDEX_LEB:
// R_WASM_GLOBAL_INDEX_LEB are can be used against function and data
- // symbols to refer to thier GOT enties.
+ // symbols to refer to their GOT entries.
if (!isValidGlobalSymbol(Reloc.Index) &&
!isValidDataSymbol(Reloc.Index) &&
!isValidFunctionSymbol(Reloc.Index))
@@ -881,12 +881,9 @@ Error WasmObjectFile::parseTypeSection(ReadContext &Ctx) {
Sig.Params.push_back(wasm::ValType(ParamType));
}
uint32_t ReturnCount = readVaruint32(Ctx);
- if (ReturnCount) {
- if (ReturnCount != 1) {
- return make_error<GenericBinaryError>(
- "Multiple return types not supported", object_error::parse_failed);
- }
- Sig.Returns.push_back(wasm::ValType(readUint8(Ctx)));
+ while (ReturnCount--) {
+ uint32_t ReturnType = readUint8(Ctx);
+ Sig.Returns.push_back(wasm::ValType(ReturnType));
}
Signatures.push_back(std::move(Sig));
}