File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change 21
21
(assert_return (invoke " store" (i32.const -4 ) (i32.const 42 )))
22
22
(assert_return (invoke " load" (i32.const -4 )) (i32.const 42 ))
23
23
(assert_trap (invoke " store" (i32.const -3 ) (i32.const 0x12345678 )) " out of bounds memory access" )
24
- ;; check that the oob store above does not store partial data.
25
- (assert_return (invoke " load" (i32.const -4 )) (i32.const 42 ))
26
24
(assert_trap (invoke " load" (i32.const -3 )) " out of bounds memory access" )
27
25
(assert_trap (invoke " store" (i32.const -2 ) (i32.const 13 )) " out of bounds memory access" )
28
26
(assert_trap (invoke " load" (i32.const -2 )) " out of bounds memory access" )
270
268
;; No memory was changed
271
269
(assert_return (invoke " i64.load" (i32.const 0xfff8 )) (i64.const 0x6867666564636261 ))
272
270
(assert_return (invoke " i64.load" (i32.const 0 )) (i64.const 0x6867666564636261 ))
271
+
272
+ ;; Check that out of bounds store do not store partial data.
273
+ ;; Zero last 8 bytes.
274
+ (assert_return (invoke " i64.store" (i32.const 0xfff8 ) (i64.const 0 )))
275
+ (assert_trap (invoke " i32.store" (i32.const 0xfffd ) (i32.const 0x12345678 )) " out of bounds memory access" )
276
+ (assert_return (invoke " i32.load" (i32.const 0xfffc )) (i32.const 0 ))
277
+ (assert_trap (invoke " i64.store" (i32.const 0xfff9 ) (i64.const 0x1234567890abcdef )) " out of bounds memory access" )
278
+ (assert_return (invoke " i64.load" (i32.const 0xfff8 )) (i64.const 0 ))
279
+ (assert_trap (invoke " f32.store" (i32.const 0xfffd ) (f32.const 0x12345678 )) " out of bounds memory access" )
280
+ (assert_return (invoke " f32.load" (i32.const 0xfffc )) (f32.const 0 ))
281
+ (assert_trap (invoke " f64.store" (i32.const 0xfff9 ) (f64.const 0x1234567890abcdef )) " out of bounds memory access" )
282
+ (assert_return (invoke " f64.load" (i32.const 0xfff8 )) (f64.const 0 ))
You can’t perform that action at this time.
0 commit comments