Skip to content

Commit 454c446

Browse files
authored
[test] Move exception tests to their own dirs and activate bulk64 test (#1951)
1 parent b25640b commit 454c446

File tree

7 files changed

+16
-11
lines changed

7 files changed

+16
-11
lines changed

interpreter/exec/eval.ml

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -157,25 +157,23 @@ let split n (vs : 'a stack) at = take n vs at, drop n vs at
157157
* c : config
158158
*)
159159

160+
let oob i n j =
161+
I64.(lt_u (add i n) i || gt_u (add i n) j)
162+
160163
let mem_oob frame x i n =
161-
let mem = (memory frame.inst x) in
162-
I64.gt_u (I64.add (addr_of_num i) (addr_of_num n))
163-
(Memory.bound mem)
164+
oob (addr_of_num i) (addr_of_num n) (Memory.bound (memory frame.inst x))
164165

165166
let data_oob frame x i n =
166-
I64.gt_u (I64.add (addr_of_num i) (addr_of_num n))
167-
(Data.size (data frame.inst x))
167+
oob (addr_of_num i) (addr_of_num n) (Data.size (data frame.inst x))
168168

169169
let table_oob frame x i n =
170-
I64.gt_u (I64.add (addr_of_num i) (addr_of_num n))
171-
(Table.size (table frame.inst x))
170+
oob (addr_of_num i) (addr_of_num n) (Table.size (table frame.inst x))
172171

173172
let elem_oob frame x i n =
174-
I64.gt_u (I64.add (addr_of_num i) (addr_of_num n))
175-
(Elem.size (elem frame.inst x))
173+
oob (addr_of_num i) (addr_of_num n) (Elem.size (elem frame.inst x))
176174

177175
let array_oob a i n =
178-
I64.gt_u (I64.add (Convert.I64_.extend_i32_u i) (Convert.I64_.extend_i32_u n))
176+
oob (Convert.I64_.extend_i32_u i) (Convert.I64_.extend_i32_u n)
179177
(Convert.I64_.extend_i32_u (Aggr.array_length a))
180178

181179
let rec step (c : config) : config =
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

test/core/run.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,14 @@
3636
relaxed_simd_test_files = glob.glob(os.path.join(inputDir, "relaxed-simd", "*.wast"))
3737
gc_test_files = glob.glob(os.path.join(inputDir, "gc", "*.wast"))
3838
multi_memory_test_files = glob.glob(os.path.join(inputDir, "multi-memory", "*.wast"))
39-
all_test_files = main_test_files + simd_test_files + relaxed_simd_test_files + gc_test_files + multi_memory_test_files
39+
exception_test_files = glob.glob(os.path.join(inputDir, "exception", "*.wast"))
40+
all_test_files = \
41+
main_test_files + \
42+
simd_test_files + \
43+
relaxed_simd_test_files + \
44+
gc_test_files + \
45+
multi_memory_test_files + \
46+
exception_test_files
4047

4148
wasmExec = arguments.wasm
4249
wasmCommand = wasmExec + " " + arguments.opts

0 commit comments

Comments
 (0)