summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2016-06-24 09:42:52 -0700
committerAlon Zakai <alonzakai@gmail.com>2016-07-06 11:50:32 -0700
commitfa050b2f9c1e4b68c5067487515d1f67ae9bf9cf (patch)
treeda02eadeae89d40f82a1e203b11e581138682129
parent5287706104bc07394e64bd73b1e1ddbc06b957b5 (diff)
downloadbinaryen-fa050b2f9c1e4b68c5067487515d1f67ae9bf9cf.tar.gz
binaryen-fa050b2f9c1e4b68c5067487515d1f67ae9bf9cf.tar.bz2
binaryen-fa050b2f9c1e4b68c5067487515d1f67ae9bf9cf.zip
update spec tests, and handle some flux in call_indirect in upstream
-rwxr-xr-xcheck.py2
-rw-r--r--src/wasm-binary.h1
-rw-r--r--src/wasm-s-parser.h8
m---------test/spec0
4 files changed, 10 insertions, 1 deletions
diff --git a/check.py b/check.py
index 214ade67b..622989006 100755
--- a/check.py
+++ b/check.py
@@ -453,7 +453,7 @@ for t in spec_tests:
# check binary format. here we can verify execution of the final result, no need for an output verification
split_num = 0
- if os.path.basename(wast) not in ['has_feature.wast']: # avoid some tests with things still in spec tests, but likely to be taken out soon
+ if os.path.basename(wast) not in ['call_indirect.wast']: # avoid some tests with things still being sorted out in the spec https://github.com/WebAssembly/spec/pull/301
actual = ''
for module, asserts in split_wast(wast):
print ' testing split module', split_num
diff --git a/src/wasm-binary.h b/src/wasm-binary.h
index a76bf7fa5..e77f3992e 100644
--- a/src/wasm-binary.h
+++ b/src/wasm-binary.h
@@ -469,6 +469,7 @@ class WasmBinaryWriter : public Visitor<WasmBinaryWriter, void> {
if (func->type.isNull()) {
func->type = ensureFunctionType(getSig(func.get()), wasm)->name;
}
+ // TODO: depending on upstream flux https://github.com/WebAssembly/spec/pull/301 might want this: assert(!func->type.isNull());
}
}
diff --git a/src/wasm-s-parser.h b/src/wasm-s-parser.h
index a48ee1a5f..c6b3809f1 100644
--- a/src/wasm-s-parser.h
+++ b/src/wasm-s-parser.h
@@ -498,6 +498,14 @@ private:
body = allocator.alloc<Nop>();
}
if (currFunction->result != result) throw ParseException("bad func declaration", s.line, s.col);
+ /* TODO: spec in flux, https://github.com/WebAssembly/spec/pull/301
+ if (type.isNull()) {
+ // if no function type provided, generate a private one for this function
+ auto* functionType = sigToFunctionType(getSig(currFunction.get()));
+ wasm.addFunctionType(functionType);
+ type = functionType->name;
+ }
+ */
currFunction->body = body;
currFunction->type = type;
wasm.addFunction(currFunction.release());
diff --git a/test/spec b/test/spec
-Subproject 1928ef28031e7041a4b2a9ae0e7dda8a8c578d2
+Subproject 88274ef4376b5a679a2cd0a1d630bf7e71f96cf