Skip to content

Order of evaluation for child nodes is not specified. #399

@Teemperor

Description

@Teemperor

It seems the spec is missing how child nodes are evaluation. Problems that could arise through that are:

1 . Child nodes with side effects would make the program behave differently on different platforms like in:

(set_local $x (i32.const 8))
(int32.div (get_local $x) (set_local $x (i32.const 4))

div could either return 1 or 0 in this case.

2 . Unnecessary locals to clarify the order of evaluation. Example from above with clear order but unnecessary locals:

(set_local $x (i32.const 8))
(set_local $right (set_local $x (i32.const 4))
(int32.div (get_local $x) (get_local $right)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions