Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2017 the V8 project authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 load("test/mjsunit/wasm/wasm-constants.js"); | |
| 6 load("test/mjsunit/wasm/wasm-module-builder.js"); | |
| 7 | |
| 8 function testGrowMemoryOutOfBoundsOffset() { | |
| 9 print("testGrowMemoryOutOfBoundsOffset2"); | |
| 10 var builder = new WasmModuleBuilder(); | |
| 11 builder.addMemory(16, 128, false); | |
| 12 builder.addFunction("main", kSig_v_v) | |
| 13 .addBody([ | |
| 14 kExprI32Const, 20, | |
| 15 kExprI32Const, 29, | |
| 16 kExprGrowMemory, kMemoryZero, | |
| 17 kExprI32StoreMem, 0, 0xFF, 0xFF, 0xFF, 0x7a | |
|
Eric Holk
2017/06/13 16:19:48
Ah, here's the way out of bounds test! Thanks.
Co
gdeepti
2017/06/13 21:25:43
Done.
| |
| 18 ]) | |
| 19 .exportAs("main"); | |
| 20 var module = builder.instantiate(); | |
| 21 assertTraps(kTrapMemOutOfBounds, module.exports.main); | |
| 22 } | |
| 23 | |
| 24 testGrowMemoryOutOfBoundsOffset(); | |
| OLD | NEW |