Skip to content

ml-proto and design disagree on grow_memory semantics #714

@sunfishcode

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions