Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(560)

Side by Side Diff: test/mjsunit/wasm/grow-memory.js

Issue 2438593003: [wasm] Remove incorrect assembler check. (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/assembler.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 the V8 project authors. All rights reserved. 1 // Copyright 2016 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 --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 kPageSize = 0x10000; 10 var kPageSize = 0x10000;
11 11
12 function genGrowMemoryBuilder() { 12 function genGrowMemoryBuilder() {
13 var builder = new WasmModuleBuilder(); 13 var builder = new WasmModuleBuilder();
14 builder.addFunction("grow_memory", kSig_i_i) 14 builder.addFunction("grow_memory", kSig_i_i)
15 .addBody([kExprGetLocal, 0, kExprGrowMemory]) 15 .addBody([kExprGetLocal, 0, kExprGrowMemory])
(...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after
434 poke(0xaced); 434 poke(0xaced);
435 assertEquals(0xaced, peek()); 435 assertEquals(0xaced, peek());
436 } 436 }
437 437
438 for (offset = 4*kPageSize - 3; offset <= 4*kPageSize + 4; offset++) { 438 for (offset = 4*kPageSize - 3; offset <= 4*kPageSize + 4; offset++) {
439 assertTraps(kTrapMemOutOfBounds, poke); 439 assertTraps(kTrapMemOutOfBounds, poke);
440 } 440 }
441 } 441 }
442 442
443 testGrowMemoryOutOfBoundsOffset(); 443 testGrowMemoryOutOfBoundsOffset();
444
445 function testGrowMemoryOutOfBoundsOffset2() {
446 var builder = new WasmModuleBuilder();
447 builder.addMemory(16, 128, false);
448 builder.addFunction("main", kSig_v_v)
449 .addBody([
450 kExprI32Const, 20,
451 kExprI32Const, 29,
452 kExprGrowMemory,
453 kExprI32StoreMem, 0, 0xFF, 0xFF, 0xFF, 0x3a
454 ])
455 .exportAs("main");
456 var module = builder.instantiate();
457 assertTraps(kTrapMemOutOfBounds, module.exports.main);
458 }
459
460 testGrowMemoryOutOfBoundsOffset2();
OLDNEW
« no previous file with comments | « src/assembler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698