| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| |
|
|
|
|
| |
This is enough to pass the testuite, but doesn't yet validate utf8
strings in the text format.
|
|
|
|
| |
This exposed a small bug where an empty init expr would have type 0,
which would print as "(null)" since it didn't exist.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Positive NaN (+nan) is defined as being a NaN value where the sign bit
is clear, the exponent is all ones, and the tag has only the "quiet" bit
set. The quiet bit is the most-significant bit of the tag. For example,
for a 32-bit float, +nan is 0x7cf00000.
"Canonical NaN" is either +nan or -nan, where -nan is +nan with the sign
bit set.
"Arithmetic NaN" is defined as any other quiet NaN (i.e. the quiet bit
must be set, but any other bit can be either 0 or 1.)
This change doesn't update the interpreter because it is only a
loosening of the previous NaN behavior.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Update wasm binary format label to 1
Rebaseline tests, but no other changes.
* Revert test/spec/globals.txt
* Update testsuite
* Update spec binary.wast test and testsuite repo
|
|
|
|
|
|
| |
Fixed a few typechecker errors:
* br_table must have consistent type signature for all branch targets
* if without else cannot have a signature
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The typechecking is now shared between the validator and
binary-reader-interpreter as well.
* Shared the various LabelType enumerations -> WabtLabelType.
* Fixed the "invalid depth" errors, the max value was incorrect.
* Removed some tests that aren't useful anymore:
- interp/if-then-br hasn't been useful for a while, but now is even
less so because it doesn't validate without dropping the i32.const
from the true branch
- typecheck/bad-br-multi-type isn't possible because the block must
specify the signature for the br.
- typecheck/bad-label-multi-type used to test matching signature for
fallthrough and br, but isn't possible because of block signatures.
|
| |
|
|
|
|
|
|
|
| |
Also:
* Check all data/elem segments before updating memory/tables
* assert_exhaustion should check for call stack or value stack
exhaustion.
* Don't allow out-of-bound size 0 data segments
|
|
|
|
| |
Also, update assert_malformed to initialize the environment so the
"spectest" module is available.
|
| |
|
|
|
|
|
|
|
| |
* Non-imported globals can not be used in initializer expressions
* block/loop/if labels can be repeated at the end
* get_global index in initializer expression should reference use module
index space, not "defined" global index space
|
| |
|
|
|
|
|
|
|
| |
* `offset=` and `align=` can now specify hex values
* data and elem segment offsets are now not checked; they can be out of
order or overlapping, and even out-of-bounds if the size is zero
* added the new tests `skip-stack-guard-page` and `unwind`
|
|
|
|
|
|
| |
This updates third_party/testsuite to the current head of the `binary_0xc` branch
(https://github.com/WebAssembly/testsuite/commit/58c1bf67cc65a1219d49114c41805bafc75ac0c6),
which is the collection of tests from the current head of the spec repo's `binary_0xc` branch
(https://github.com/WebAssembly/spec/commit/0fa1531c2deebb767b263d405dbce849c9663f55).
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Change 7c482b1a of the spec repo now requires that implicit function
types are created when creating a new func or import, but only when the
type is not explicitly specified, and the have not been specified. For
example:
```
(func (param i32))
(import "foo" "bar" (result i32)
```
This was previously done in sexpr-wasm when writing the binary, but now
these types can be referenced by `call_import`, so it has to be handled
earlier.
Since all signatures are now defined in the module, I made it so the
function signature is shared with the module function types. The tricky
part here is when a function type and an explicit signature are both
specified:
```
(func (type $t) (param f32) ...)
```
In this case, we need to keep the explicit signature around long enough
to be checked against the function type, so it must be owned by the
function. The WASM_FUNC_DECLARATION_FLAG_SHARED_SIGNATURE flag specifies
this case.
To simplify code that uses the AST, I reverted many of the
changes introduced in 73e5bc7d. Now the function declaration's signature
is always valid to access, and will have been resolved if it was
specified with a func type instead of an explicit signature.
Some other changes:
* There was a bug in the interpreter's `f32.demote/f64` rounding when
given a value that is very close to positive or negative F32_MAX
* Added `update-spec-tests.py` to more easily update the spec tests in
`test/interp/spec/*.txt` from the files in
`third_party/testsuite/*.wast`. Previously I would just do it
manually.
|
|
|
|
|
| |
`(func (br 0))` is valid, because the function introduces an implicit
block scope. This change also updates the testsuite (which has tests for
this behavior).
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Modify AST parser to disallow any other order than `param`, `result`,
`local`.
* Allow parsing all var integers as int64 (the lookups will fail later.)
* Fix interpreter logic determining whether to adjust the stack; we were
correctly handling the case where `unreachable` was being used in an
expression (the value stack is adjusted "up" as if a value was
actually produced), but the same behavior is required for `br`,
`br_table` and `return`.
* Add NAT token to lexer/parser, which is an integer value without a
sign.
|
| |
|
|
|
|
|
|
|
|
|
| |
* Parse memory pages as uint64, as we need to check whether it's invalid
in assert_invalid, and one of the spec tests uses the value 2**32.
* Update WASM_MAX_PAGES to 65535 (not 65536)
* Add the new spec tests: binary.wast, break-drop.wast and
typecheck.wast. A couple of these were added before, but weren't added
as .txt files in the test directory.
|
|
|
|
|
|
|
| |
* current_memory and grow_memory return page size, not byte size
* also update testsuite, which fixes a couple of spec tests
* disable d8/spec tests (in a hacky way), because the binary_0xb v8
support isn't landed yet, so we can't easily test it
|
| |
|
| |
|
|
|
|
|
| |
spec/switch.txt is still failing because we don't yet support br_table
passing an argument.
|
|
|
|
| |
Also update testsuite
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Condition now comes last in br_if:
BR_IF var cond
BR_IF var expr cond
It should also be evaluated last, but that hasn't been updated in v8
yet.
|
|
|
|
|
|
| |
Select was changed to (select true_val false_val cond). There are new
failures in test/spec/left-to-right.wast because the evaluation order is
now incorrect in d8.
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
The spec repo was updated to remove the label node, so now blocks always
introduce a new block scope. This breaks the memory and switch spec
tests.
|
|
|
|
| |
This fixes a number of spec test. Only a few assertions fail now. :)
|
|
|
|
|
| |
This breaks labels.wast, because sexpr-wasm doesn't currently parse
br_if values.
|
| |
|
|
|
|
|
|
|
| |
Test changes:
- spec tests no longer reference page_size
- address.txt fails because offset > uint32 is currently allowed in
sexpr-wasm.
|
| |
|
| |
|
|
|