Skip to content
This repository was archived by the owner on Nov 3, 2021. It is now read-only.

Commit 303c942

Browse files
committed
Merge remote-tracking branch 'upstream/master'
2 parents 34a7ebe + f89d298 commit 303c942

File tree

11 files changed

+34
-17
lines changed

11 files changed

+34
-17
lines changed

document/core/exec/modules.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Modules
22
-------
33

4-
For modules, the execution semantics primarily defines :ref:`instantiation <exec-instantiation>`, which :ref:`allocates <alloc>` instances for a module and its contained definitions, inititializes :ref:`tables <syntax-table>` and :ref:`memories <syntax-mem>` from contained :ref:`element <syntax-elem>` and :ref:`data <syntax-data>` segments, and invokes the :ref:`start function <syntax-start>` if present. It also includes :ref:`invocation <exec-invocation>` of exported functions.
4+
For modules, the execution semantics primarily defines :ref:`instantiation <exec-instantiation>`, which :ref:`allocates <alloc>` instances for a module and its contained definitions, initializes :ref:`tables <syntax-table>` and :ref:`memories <syntax-mem>` from contained :ref:`element <syntax-elem>` and :ref:`data <syntax-data>` segments, and invokes the :ref:`start function <syntax-start>` if present. It also includes :ref:`invocation <exec-invocation>` of exported functions.
55

66
Instantiation depends on a number of auxiliary notions for :ref:`type-checking imports <exec-import>` and :ref:`allocating <alloc>` instances.
77

interpreter/exec/eval.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ let rec step (c : config) : config =
157157
vs', [Plain (Br (Lib.List32.nth xs i)) @@ e.at]
158158

159159
| Return, vs ->
160-
vs, [Returning vs @@ e.at]
160+
[], [Returning vs @@ e.at]
161161

162162
| Call x, vs ->
163163
vs, [Invoke (func frame.inst x) @@ e.at]

test/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
This directory contains the WebAssembly test suite. It is split into two
1+
This directory contains the WebAssembly test suite. It is split into three
22
directories:
33

44
* [`core/`](core/), tests for the core semantics

test/core/call_indirect.wast

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -938,5 +938,5 @@
938938

939939
(assert_invalid
940940
(module (table funcref (elem 0 0)))
941-
"unknown function 0"
941+
"unknown function"
942942
)

test/core/data.wast

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@
283283
(module
284284
(data (i32.const 0) "")
285285
)
286-
"unknown memory 0"
286+
"unknown memory"
287287
)
288288

289289
;; Invalid offsets

test/core/elem.wast

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@
249249
(func $f)
250250
(elem (i32.const 0) $f)
251251
)
252-
"unknown table 0"
252+
"unknown table"
253253
)
254254

255255
;; Invalid offsets

test/core/i32.wast

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@
6262
(assert_trap (invoke "div_s" (i32.const 1) (i32.const 0)) "integer divide by zero")
6363
(assert_trap (invoke "div_s" (i32.const 0) (i32.const 0)) "integer divide by zero")
6464
(assert_trap (invoke "div_s" (i32.const 0x80000000) (i32.const -1)) "integer overflow")
65+
(assert_trap (invoke "div_s" (i32.const 0x80000000) (i32.const 0)) "integer divide by zero")
6566
(assert_return (invoke "div_s" (i32.const 1) (i32.const 1)) (i32.const 1))
6667
(assert_return (invoke "div_s" (i32.const 0) (i32.const 1)) (i32.const 0))
6768
(assert_return (invoke "div_s" (i32.const 0) (i32.const -1)) (i32.const 0))

test/core/i64.wast

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@
6262
(assert_trap (invoke "div_s" (i64.const 1) (i64.const 0)) "integer divide by zero")
6363
(assert_trap (invoke "div_s" (i64.const 0) (i64.const 0)) "integer divide by zero")
6464
(assert_trap (invoke "div_s" (i64.const 0x8000000000000000) (i64.const -1)) "integer overflow")
65+
(assert_trap (invoke "div_s" (i64.const 0x8000000000000000) (i64.const 0)) "integer divide by zero")
6566
(assert_return (invoke "div_s" (i64.const 1) (i64.const 1)) (i64.const 1))
6667
(assert_return (invoke "div_s" (i64.const 0) (i64.const 1)) (i64.const 0))
6768
(assert_return (invoke "div_s" (i64.const 0) (i64.const -1)) (i64.const 0))

test/core/if.wast

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -892,42 +892,42 @@
892892

893893

894894
(assert_malformed
895-
(module quote "(func if end $l)")
895+
(module quote "(func i32.const 0 if end $l)")
896896
"mismatching label"
897897
)
898898
(assert_malformed
899-
(module quote "(func if $a end $l)")
899+
(module quote "(func i32.const 0 if $a end $l)")
900900
"mismatching label"
901901
)
902902
(assert_malformed
903-
(module quote "(func if else $l end)")
903+
(module quote "(func i32.const 0 if else $l end)")
904904
"mismatching label"
905905
)
906906
(assert_malformed
907-
(module quote "(func if $a else $l end)")
907+
(module quote "(func i32.const 0 if $a else $l end)")
908908
"mismatching label"
909909
)
910910
(assert_malformed
911-
(module quote "(func if else end $l)")
911+
(module quote "(func i32.const 0 if else end $l)")
912912
"mismatching label"
913913
)
914914
(assert_malformed
915-
(module quote "(func if else $l end $l)")
915+
(module quote "(func i32.const 0 if else $l end $l)")
916916
"mismatching label"
917917
)
918918
(assert_malformed
919-
(module quote "(func if else $l1 end $l2)")
919+
(module quote "(func i32.const 0 if else $l1 end $l2)")
920920
"mismatching label"
921921
)
922922
(assert_malformed
923-
(module quote "(func if $a else end $l)")
923+
(module quote "(func i32.const 0 if $a else end $l)")
924924
"mismatching label"
925925
)
926926
(assert_malformed
927-
(module quote "(func if $a else $a end $l)")
927+
(module quote "(func i32.const 0 if $a else $a end $l)")
928928
"mismatching label"
929929
)
930930
(assert_malformed
931-
(module quote "(func if $a else $l end $l)")
931+
(module quote "(func i32.const 0 if $a else $l end $l)")
932932
"mismatching label"
933-
)
933+
)

test/core/names.wast

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -603,6 +603,13 @@
603603

604604
;; Test an unusual character.
605605
(func (export "") (result i32) (i32.const 475))
606+
607+
;; Test the three characters whose normalization forms under NFC, NFD, NFKC,
608+
;; and NFKD are all different.
609+
;; http://unicode.org/faq/normalization.html#6
610+
(func (export "ϓ") (result i32) (i32.const 476))
611+
(func (export "ϔ") (result i32) (i32.const 477))
612+
(func (export "") (result i32) (i32.const 478))
606613
)
607614

608615
(assert_return (invoke "") (i32.const 0))
@@ -1081,6 +1088,9 @@
10811088
(assert_return (invoke "") (i32.const 473))
10821089
(assert_return (invoke "") (i32.const 474))
10831090
(assert_return (invoke "") (i32.const 475))
1091+
(assert_return (invoke "ϓ") (i32.const 476))
1092+
(assert_return (invoke "ϔ") (i32.const 477))
1093+
(assert_return (invoke "") (i32.const 478))
10841094

10851095
(module
10861096
;; Test that we can use indices instead of names to reference imports,

test/core/unreachable.wast

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,9 @@
107107
(func (export "as-if-else") (param i32 i32) (result i32)
108108
(if (result i32) (local.get 0) (then (local.get 1)) (else (unreachable)))
109109
)
110+
(func (export "as-if-then-no-else") (param i32 i32) (result i32)
111+
(if (local.get 0) (then (unreachable))) (local.get 1)
112+
)
110113

111114
(func (export "as-select-first") (param i32 i32) (result i32)
112115
(select (unreachable) (local.get 0) (local.get 1))
@@ -255,6 +258,8 @@
255258
(assert_return (invoke "as-if-then" (i32.const 0) (i32.const 6)) (i32.const 6))
256259
(assert_trap (invoke "as-if-else" (i32.const 0) (i32.const 6)) "unreachable")
257260
(assert_return (invoke "as-if-else" (i32.const 1) (i32.const 6)) (i32.const 6))
261+
(assert_trap (invoke "as-if-then-no-else" (i32.const 1) (i32.const 6)) "unreachable")
262+
(assert_return (invoke "as-if-then-no-else" (i32.const 0) (i32.const 6)) (i32.const 6))
258263

259264
(assert_trap (invoke "as-select-first" (i32.const 0) (i32.const 6)) "unreachable")
260265
(assert_trap (invoke "as-select-first" (i32.const 1) (i32.const 6)) "unreachable")

0 commit comments

Comments
 (0)