Skip to content

ml-proto's grow_memory traps on integer overflow #307

Closed

Description

@sunfishcode

The design repo says that grow_memory should return -1 on allocation failure and does not mention the possibility of trapping:
https://github.com/WebAssembly/design/blob/master/AstSemantics.md#resizing

ml-proto's implementation for grow_memory traps on overflow when converting from pages to bytes, or if the size exceeds an internal implementation limit and does not appear to have code for returning -1 on allocation failure:
https://github.com/WebAssembly/spec/blob/master/ml-proto/spec/eval.ml#L288
https://github.com/WebAssembly/spec/blob/master/ml-proto/spec/memory.ml#L71

(Moving this issue from WebAssembly/design#714, since this appears to be an ml-proto issue rather than a design issue.)

Activity

  1. added this to the MVP milestone on Jul 12, 2016
  2. modified the milestones: 0xC, MVP on Jul 12, 2016
  3. rossberg commented on Aug 16, 2016

    @rossberg
    Member

    Fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions