2015-12-11 12:26:16 +00:00
|
|
|
// 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"
|
|
|
|
|
2019-05-24 13:51:59 +00:00
|
|
|
#include "src/init/v8.h"
|
2015-12-11 12:26:16 +00:00
|
|
|
|
2019-05-23 08:51:46 +00:00
|
|
|
#include "src/objects/objects-inl.h"
|
2016-12-21 12:42:06 +00:00
|
|
|
#include "src/wasm/function-body-decoder.h"
|
2016-09-29 11:29:05 +00:00
|
|
|
#include "src/wasm/wasm-module-builder.h"
|
2015-12-11 12:26:16 +00:00
|
|
|
|
2016-10-05 11:59:47 +00:00
|
|
|
#include "test/common/wasm/test-signatures.h"
|
2016-05-17 17:53:46 +00:00
|
|
|
|
2015-12-11 12:26:16 +00:00
|
|
|
namespace v8 {
|
|
|
|
namespace internal {
|
|
|
|
namespace wasm {
|
|
|
|
|
2016-09-29 11:29:05 +00:00
|
|
|
class WasmModuleBuilderTest : public TestWithZone {
|
2015-12-11 12:26:16 +00:00
|
|
|
protected:
|
2016-12-21 13:43:00 +00:00
|
|
|
void AddLocal(WasmFunctionBuilder* f, ValueType type) {
|
2015-12-11 12:26:16 +00:00
|
|
|
uint16_t index = f->AddLocal(type);
|
2016-04-21 10:14:34 +00:00
|
|
|
f->EmitGetLocal(index);
|
2015-12-11 12:26:16 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2016-09-29 11:29:05 +00:00
|
|
|
TEST_F(WasmModuleBuilderTest, Regression_647329) {
|
2016-09-20 14:03:08 +00:00
|
|
|
// Test crashed with asan.
|
|
|
|
ZoneBuffer buffer(zone());
|
|
|
|
const size_t kSize = ZoneBuffer::kInitialSize * 3 + 4096 + 100;
|
2018-09-21 00:32:01 +00:00
|
|
|
byte data[kSize] = {0};
|
2016-09-20 14:03:08 +00:00
|
|
|
buffer.write(data, kSize);
|
|
|
|
}
|
|
|
|
|
2015-12-11 12:26:16 +00:00
|
|
|
} // namespace wasm
|
|
|
|
} // namespace internal
|
|
|
|
} // namespace v8
|