80c7ab4d77
The previous code was relying on {compilation_unit_builder_} to check if a section was after or before the code section. This only works for the first section after code section, since the compilation unit builder is then reset. Use an additional field to track this instead. R=clemensb@chromium.org Bug: chromium:1051912 Change-Id: Id1dfa803ecde2cf77f206ea781c007fc61168942 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2054099 Commit-Queue: Thibaud Michaud <thibaudm@chromium.org> Reviewed-by: Clemens Backes <clemensb@chromium.org> Cr-Commit-Position: refs/heads/master@{#66265}
18 lines
691 B
JavaScript
18 lines
691 B
JavaScript
// Copyright 2020 the V8 project authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
|
|
load('test/mjsunit/wasm/wasm-module-builder.js')
|
|
|
|
let binary = new Binary();
|
|
binary.emit_header();
|
|
binary.emit_bytes([kTypeSectionCode, 4, 1, kWasmFunctionTypeForm, 0, 0]);
|
|
binary.emit_bytes([kFunctionSectionCode, 2, 1, 0]);
|
|
binary.emit_bytes([kCodeSectionCode, 6, 1, 4]);
|
|
binary.emit_bytes([kUnknownSectionCode, 2, 1, 0]);
|
|
binary.emit_bytes([kUnknownSectionCode, 2, 1, 0]);
|
|
binary.emit_bytes([kUnknownSectionCode, 2, 1, 0]);
|
|
binary.emit_bytes([ kExprEnd]);
|
|
let buffer = binary.trunc_buffer();
|
|
WebAssembly.compile(buffer);
|