Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(793)

Unified Diff: test/mjsunit/wasm/wasm-module-builder.js

Issue 2501873003: [wasm] Be more lenient on the names section. (Closed)
Patch Set: Fix builders to add empty import names. Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/wasm/wasm-module-builder.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 4f4633cbd578881a888256a3a2f95a65325166df..900198d7d03efbde455a06e63eb269a8e47bc9ce 100644
--- a/test/mjsunit/wasm/wasm-module-builder.js
+++ b/test/mjsunit/wasm/wasm-module-builder.js
@@ -522,7 +522,12 @@ class WasmModuleBuilder {
if (debug) print("emitting names @ " + binary.length);
binary.emit_section(kUnknownSectionCode, section => {
section.emit_string("name");
- section.emit_u32v(wasm.functions.length);
+ var count = wasm.functions.length + wasm.num_imported_funcs;
+ section.emit_u32v(count);
+ for (var i = 0; i < wasm.num_imported_funcs; i++) {
+ section.emit_u8(0); // empty string
+ section.emit_u8(0); // local names count == 0
+ }
for (let func of wasm.functions) {
var name = func.name == undefined ? "" : func.name;
section.emit_string(name);
« no previous file with comments | « src/wasm/wasm-module-builder.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698