OLD | NEW |
---|---|
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Flags: --expose-wasm --expose-gc --stress-compaction | 5 // Flags: --expose-wasm --expose-gc --stress-compaction |
6 | 6 |
7 load("test/mjsunit/wasm/wasm-constants.js"); | 7 load("test/mjsunit/wasm/wasm-constants.js"); |
8 load("test/mjsunit/wasm/wasm-module-builder.js"); | 8 load("test/mjsunit/wasm/wasm-module-builder.js"); |
9 | 9 |
10 var kMemSize = 65536; | 10 var kMemSize = 65536; |
11 | |
bradnelson
2016/07/21 19:05:20
No real change in file, drop it.
| |
12 function genModule(memory) { | 11 function genModule(memory) { |
13 var builder = new WasmModuleBuilder(); | 12 var builder = new WasmModuleBuilder(); |
14 | 13 |
15 builder.addMemory(1, 1, true); | 14 builder.addMemory(1, 1, true); |
16 builder.addFunction("main", kSig_i_i) | 15 builder.addFunction("main", kSig_i_i) |
17 .addBody([ | 16 .addBody([ |
18 // main body: while(i) { if(mem[i]) return -1; i -= 4; } return 0; | 17 // main body: while(i) { if(mem[i]) return -1; i -= 4; } return 0; |
19 kExprLoop, | 18 kExprLoop, |
20 kExprGetLocal,0, | 19 kExprGetLocal,0, |
21 kExprIf, | 20 kExprIf, |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
149 } | 148 } |
150 | 149 |
151 | 150 |
152 for (offset = 65534; offset < 66536; offset++) { | 151 for (offset = 65534; offset < 66536; offset++) { |
153 assertTraps(kTrapMemOutOfBounds, read); | 152 assertTraps(kTrapMemOutOfBounds, read); |
154 assertTraps(kTrapMemOutOfBounds, write); | 153 assertTraps(kTrapMemOutOfBounds, write); |
155 } | 154 } |
156 } | 155 } |
157 | 156 |
158 testOOBThrows(); | 157 testOOBThrows(); |
OLD | NEW |