Index: test/unittests/wasm/ast-decoder-unittest.cc |
diff --git a/test/unittests/wasm/ast-decoder-unittest.cc b/test/unittests/wasm/ast-decoder-unittest.cc |
index fe1011574966a1eff77edb779ded31ee1808a0fc..f9b78f14da5aa668cd7646448535c8dc5d4afcfb 100644 |
--- a/test/unittests/wasm/ast-decoder-unittest.cc |
+++ b/test/unittests/wasm/ast-decoder-unittest.cc |
@@ -82,7 +82,7 @@ class AstDecoderTest : public TestWithZone { |
// verification failures. |
void Verify(ErrorCode expected, FunctionSig* sig, const byte* start, |
const byte* end) { |
- local_decls.Prepend(&start, &end); |
+ local_decls.Prepend(zone(), &start, &end); |
// Verify the code. |
TreeResult result = |
VerifyWasmCode(zone()->allocator(), module, sig, start, end); |
@@ -105,8 +105,6 @@ class AstDecoderTest : public TestWithZone { |
} |
FATAL(str.str().c_str()); |
} |
- |
- delete[] start; // local_decls.Prepend() allocated a new buffer. |
} |
void TestBinop(WasmOpcode opcode, FunctionSig* success) { |
@@ -2427,7 +2425,7 @@ TEST_F(LocalDeclDecoderTest, UseEncoder) { |
local_decls.AddLocals(5, kAstF32); |
local_decls.AddLocals(1337, kAstI32); |
local_decls.AddLocals(212, kAstI64); |
- local_decls.Prepend(&data, &end); |
+ local_decls.Prepend(zone(), &data, &end); |
AstLocalDecls decls(zone()); |
bool result = DecodeLocalDecls(decls, data, end); |
@@ -2439,7 +2437,6 @@ TEST_F(LocalDeclDecoderTest, UseEncoder) { |
pos = ExpectRun(map, pos, kAstF32, 5); |
pos = ExpectRun(map, pos, kAstI32, 1337); |
pos = ExpectRun(map, pos, kAstI64, 212); |
- delete[] data; |
} |
} // namespace wasm |