From b367c4a74281b0673dba2f50856c55768bf3df74 Mon Sep 17 00:00:00 2001 From: Raphael Isemann Date: Tue, 13 Oct 2015 09:07:10 +0200 Subject: Update AstSemantics.md --- AstSemantics.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/AstSemantics.md b/AstSemantics.md index 43be9d4..b5cc028 100644 --- a/AstSemantics.md +++ b/AstSemantics.md @@ -181,11 +181,12 @@ greatest alignment values practical, while always avoiding misaligned accesses. ### Order of evaluation -Operand evaluation order is deterministic. +The evaluation order of child nodes is deterministic. + All nodes other than control flow constructs need to evaluate their child nodes in the order they appear in the serialized AST. -For example, this s-expression presentation of a i32.add node `(i32.add (i32.const 2) (get_local $x))` -would first evaluate the `(i32.const 2)` node and afterwards the `(get_local $x)` node. +For example, the s-expression presentation of the `i32.add` node `(i32.add (set_local $x (i32.const 1)) (set_local $x (i32.const 2)))` +would first evaluate the child node `(set_local $x (i32.const 1))` and afterwards the child node `(set_local $x (i32.const 2))`. The value of the local variable $x will be `2` after the `i32.add` node is fully evaluated. ### Out of Bounds -- cgit v1.2.3