Skip to content

Commit

Permalink
Fix memory.{init,drop} mistakes in overview (WebAssembly#14)
Browse files Browse the repository at this point in the history
Using `memory.init` or `memory.drop` on an active segment is a validation error, not a trap.
  • Loading branch information
binji authored May 10, 2018
1 parent c86bece commit 9319fa7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion proposals/bulk-memory-operations/Overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,9 @@ step 11 of
but it behaves as though the segment were specified with the source offset,
target offset, and length as given by the `memory.init` operands.

It is a validation error to use `memory.init` with an active segment.

A trap occurs if:
* the segment is passive
* the segment is used after it has been dropped via `memory.drop`
* any of the accessed bytes lies outside the source data segment or the target memory

Expand All @@ -226,6 +227,8 @@ instruction. This instruction is intended to be used as an optimization hint to
the WebAssembly implementation. After a memory segment is dropped its data can
no longer be retrieved, so the memory used by this segment may be freed.

It is a validation error to use `memory.drop` with an active segment.

### `memory.copy` instruction

Copy data from a source memory region to destination region; these regions may
Expand Down

0 comments on commit 9319fa7

Please sign in to comment.