File tree Expand file tree Collapse file tree
test/mjsunit/regress/wasm Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -341,11 +341,7 @@ void RelocInfo::update_wasm_function_table_size_reference(
341341 Isolate* isolate, uint32_t old_size, uint32_t new_size,
342342 ICacheFlushMode icache_flush_mode) {
343343 DCHECK (IsWasmFunctionTableSizeReference (rmode_));
344- uint32_t current_size_reference = wasm_function_table_size_reference ();
345- uint32_t updated_size_reference =
346- new_size + (current_size_reference - old_size);
347- unchecked_update_wasm_size (isolate, updated_size_reference,
348- icache_flush_mode);
344+ unchecked_update_wasm_size (isolate, new_size, icache_flush_mode);
349345}
350346
351347void RelocInfo::set_target_address (Isolate* isolate, Address target,
Original file line number Diff line number Diff line change 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+ // Flags: --expose-wasm
6+
7+ 'use strict' ;
8+
9+ load ( "test/mjsunit/wasm/wasm-constants.js" ) ;
10+ load ( "test/mjsunit/wasm/wasm-module-builder.js" ) ;
11+
12+ var builder = new WasmModuleBuilder ( ) ;
13+ builder . addImportedTable ( "x" , "table" , 1 , 10000000 ) ;
14+ builder . addFunction ( "main" , kSig_i_i )
15+ . addBody ( [
16+ kExprI32Const , 0 ,
17+ kExprGetLocal , 0 ,
18+ kExprCallIndirect , 0 , kTableZero ] )
19+ . exportAs ( "main" ) ;
20+ let module = new WebAssembly . Module ( builder . toBuffer ( ) ) ;
21+ let table = new WebAssembly . Table ( { element : "anyfunc" ,
22+ initial : 1 , maximum :1000000 } ) ;
23+ let instance = new WebAssembly . Instance ( module , { x : { table :table } } ) ;
24+
25+ table . grow ( 0x40001 ) ;
26+
27+ let instance2 = new WebAssembly . Instance ( module , { x : { table :table } } ) ;
28+
29+ try {
30+ instance2 . exports . main ( 402982 ) ; // should be OOB
31+ } catch ( e ) {
32+ print ( "Correctly caught: " , e ) ;
33+ }
You can’t perform that action at this time.
0 commit comments