Skip to content

Spec test update #621

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 6, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion check.py
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ def fix(x):

# 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
Expand Down
4 changes: 2 additions & 2 deletions src/parsing.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ inline Expression* parseConst(cashew::IString s, WasmType type, MixedArena& allo
ret->value = Literal(negative ? -temp : temp);
} else {
std::istringstream istr(str);
int32_t temp;
uint32_t temp;
istr >> temp;
ret->value = Literal(temp);
}
Expand All @@ -143,7 +143,7 @@ inline Expression* parseConst(cashew::IString s, WasmType type, MixedArena& allo
ret->value = Literal(negative ? -temp : temp);
} else {
std::istringstream istr(str);
int64_t temp;
uint64_t temp;
istr >> temp;
ret->value = Literal(temp);
}
Expand Down
5 changes: 4 additions & 1 deletion src/tools/binaryen-shell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,10 @@ static void run_asserts(size_t* i, bool* checked, Module* wasm,
Colors::green(std::cerr);
std::cerr << " CHECKING: ";
Colors::normal(std::cerr);
std::cerr << curr << '\n';
std::cerr << curr;
Colors::green(std::cerr);
std::cerr << " [line: " << curr.line << "]\n";
Colors::normal(std::cerr);
if (id == ASSERT_INVALID) {
// a module invalidity test
Module wasm;
Expand Down
1 change: 1 addition & 0 deletions src/wasm-binary.h
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
}

Expand Down
8 changes: 8 additions & 0 deletions src/wasm-s-parser.h
Original file line number Diff line number Diff line change
Expand Up @@ -498,6 +498,14 @@ class SExpressionWasmBuilder {
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());
Expand Down