Index: test/mjsunit/wasm/wasm-module-builder.js |
diff --git a/test/mjsunit/wasm/wasm-module-builder.js b/test/mjsunit/wasm/wasm-module-builder.js |
index dd150018917ad795eded1cef51e3d74706bbcd8d..bdd8cda97f15f62f4c98f751f972da51fef6f2dd 100644 |
--- a/test/mjsunit/wasm/wasm-module-builder.js |
+++ b/test/mjsunit/wasm/wasm-module-builder.js |
@@ -158,7 +158,7 @@ WasmModuleBuilder.prototype.toArray = function(debug) { |
emit_varint(bytes, this.signatures.length); |
for (sig of this.signatures) { |
var params = sig.length - 1; |
- emit_u8(bytes, params); |
+ emit_varint(bytes, params); |
for (var j = 0; j < sig.length; j++) { |
emit_u8(bytes, sig[j]); |
} |
@@ -171,7 +171,7 @@ WasmModuleBuilder.prototype.toArray = function(debug) { |
emit_u8(bytes, kDeclImportTable); |
emit_varint(bytes, this.imports.length); |
for (imp of this.imports) { |
- emit_u16(bytes, imp.sig_index); |
+ emit_varint(bytes, imp.sig_index); |
emit_string(bytes, ""); |
emit_string(bytes, imp.name); |
} |
@@ -218,7 +218,7 @@ WasmModuleBuilder.prototype.toArray = function(debug) { |
local_decls.push({count: l.f64_count, type: kAstF64}); |
} |
} |
- emit_u8(bytes, local_decls.length); |
+ emit_varint(bytes, local_decls.length); |
for (decl of local_decls) { |
emit_varint(bytes, decl.count); |
emit_u8(bytes, decl.type); |
@@ -247,7 +247,7 @@ WasmModuleBuilder.prototype.toArray = function(debug) { |
emit_u8(bytes, kDeclFunctionTable); |
emit_varint(bytes, this.function_table.length); |
for (index of this.function_table) { |
- emit_u16(bytes, index); |
+ emit_varint(bytes, index); |
} |
} |
@@ -257,7 +257,7 @@ WasmModuleBuilder.prototype.toArray = function(debug) { |
emit_varint(bytes, exports); |
for (func of this.functions) { |
for (exp of func.exports) { |
- emit_u16(bytes, func.index); |
+ emit_varint(bytes, func.index); |
emit_string(bytes, exp); |
} |
} |