summaryrefslogtreecommitdiff
path: root/deps/v8/test/unittests/wasm/wasm-module-builder-unittest.cc
blob: 807fc4095984f5f53bd065988ea2c856e48c709d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// Copyright 2015 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.

#include "test/unittests/test-utils.h"

#include "src/v8.h"

#include "src/objects-inl.h"
#include "src/wasm/function-body-decoder.h"
#include "src/wasm/wasm-module-builder.h"

#include "test/common/wasm/test-signatures.h"

namespace v8 {
namespace internal {
namespace wasm {

class WasmModuleBuilderTest : public TestWithZone {
 protected:
  void AddLocal(WasmFunctionBuilder* f, ValueType type) {
    uint16_t index = f->AddLocal(type);
    f->EmitGetLocal(index);
  }
};

TEST_F(WasmModuleBuilderTest, Regression_647329) {
  // Test crashed with asan.
  ZoneBuffer buffer(zone());
  const size_t kSize = ZoneBuffer::kInitialSize * 3 + 4096 + 100;
  byte data[kSize] = {0};
  buffer.write(data, kSize);
}

}  // namespace wasm
}  // namespace internal
}  // namespace v8