aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaphael Isemann <teemperor@googlemail.com>2015-10-13 09:07:10 +0200
committerRaphael Isemann <teemperor@googlemail.com>2015-10-13 09:07:10 +0200
commitb367c4a74281b0673dba2f50856c55768bf3df74 (patch)
treea33c006ebebc70e4f22e210c7fe77369a8468761
parent6e0d429ee85b8bac3fc84fe25658de20452d70b4 (diff)
downloadnanowasm-design-b367c4a74281b0673dba2f50856c55768bf3df74.tar.gz
Update AstSemantics.md
-rw-r--r--AstSemantics.md7
1 files 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