From 34b3761d3daf29c181da8c72edfc9a0b9bf1e6db Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Tue, 15 Mar 2016 12:42:10 -0700 Subject: num params in signatures is LEB128 --- src/wasm-binary.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/wasm-binary.h b/src/wasm-binary.h index ba0554fd8..a24bad3c8 100644 --- a/src/wasm-binary.h +++ b/src/wasm-binary.h @@ -468,7 +468,7 @@ public: o << LEB128(wasm->functionTypes.size()); for (auto* type : wasm->functionTypes) { if (debug) std::cerr << "write one" << std::endl; - o << int8_t(type->params.size()); + o << LEB128(type->params.size()); o << binaryWasmType(type->result); for (auto param : type->params) { o << binaryWasmType(param); @@ -1183,7 +1183,7 @@ public: for (size_t i = 0; i < numTypes; i++) { if (debug) std::cerr << "read one" << std::endl; auto curr = allocator.alloc(); - size_t numParams = getInt8(); + size_t numParams = getLEB128(); if (debug) std::cerr << "num params: " << numParams << std::endl; curr->result = getWasmType(); for (size_t j = 0; j < numParams; j++) { -- cgit v1.2.3