Skip to content
This repository has been archived by the owner on Dec 22, 2021. It is now read-only.

Commit

Permalink
Check that partially-oob stores do not store partial data (#1384)
Browse files Browse the repository at this point in the history
For #1250. More tests for different data types in a follow-up.
  • Loading branch information
ngzhian authored Oct 27, 2021
1 parent 0fd42ae commit b506bda
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion test/core/memory_trap.wast
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@

(assert_return (invoke "store" (i32.const -4) (i32.const 42)))
(assert_return (invoke "load" (i32.const -4)) (i32.const 42))
(assert_trap (invoke "store" (i32.const -3) (i32.const 13)) "out of bounds memory access")
(assert_trap (invoke "store" (i32.const -3) (i32.const 0x12345678)) "out of bounds memory access")
;; check that the oob store above does not store partial data.
(assert_return (invoke "load" (i32.const -4)) (i32.const 42))
(assert_trap (invoke "load" (i32.const -3)) "out of bounds memory access")
(assert_trap (invoke "store" (i32.const -2) (i32.const 13)) "out of bounds memory access")
(assert_trap (invoke "load" (i32.const -2)) "out of bounds memory access")
Expand Down

0 comments on commit b506bda

Please sign in to comment.