summaryrefslogtreecommitdiff
path: root/test/spec/memory.txt
Commit message (Collapse)AuthorAgeFilesLines
* Update testsuite (#2495)Keith Winstein2024-10-301-1/+1
| | | | | The memory64 `table.wast` test has started to depend on function-references and gc (which WABT doesn't support yet), so vendor an older version of the test.
* memory64: when enabled, check offset range at validation-time (#2253)Keith Winstein2023-06-121-4/+8
| | | | | | | | | | | | | | | | * memory64: when enabled, offset range check is at validation-time Before memory64, the "offset" in a load/store expression was a u32, and we enforced this in the WastParser and BinaryReader. After memory64, the "offset" becomes a u64 syntactically, and the validator checks that it's <= UINT32_MAX for i32 memories. We hadn't been correctly allowing these very large offsets in the text format (even when memory64 was enabled and the memory was i64). (This change also eliminates the "memories" member in the BinaryReader. The BinaryReader no longer needs to keep track of the memories and their types to check well-formedness.)
* Track locations of Vars in BinaryReaderIR and BinaryReaderInterp (#1963)Keith Winstein2022-08-151-5/+5
| | | | - Rebase test output to match new location tracking on Vars - Eliminate single-argument Var() constructor.
* update br_table validation rule + enforce module validity in spectest-interp ↵Keith Winstein2022-04-131-1/+1
| | | | (#1895)
* Add error locations to BinaryReaderInterp (#1780)Sam Clegg2021-12-091-9/+9
| | | | I think it was always intended to work this way but was left as a TODO.
* Add multi-memory feature support (#1751)Yuhan Deng2021-11-301-2/+2
|
* Added initial "memory64" proposal support (#1500)Wouter van Oortmerssen2020-08-071-8/+4
|
* Update testsuite (#1424)Ben Smith2020-05-131-25/+40
| | | | | | | Includes the three merged proposals (nontrapping-float-to-int, sign-extension, multi-value). It also has one bug fix when parsing table limits (when the min or max size does not fit in a 32-bit int).
* Update testsuite (#1381)Ben Smith2020-03-271-1/+13
| | | | * Add i{8x16,16x8,32x4}.abs instructions * Implement IntAbs in interp-math.h
* Remove validation from the BinaryReader (#1354)Ben Smith2020-03-111-12/+24
| | | | | | | Validation should only happen in ValidateModule, BinaryReader should only check whether the binary is malformed. This change also fixes a few places in BinaryReaderIR where an index is assumed to be valid.
* Fix TODOs in validator; only affects error outputBen Smith2020-02-291-6/+6
| | | | | | The major change to the error output is showing the max value instead of max value - 1. It's a bit weird to see "out of range: 0 (max 0)" but seeing 4294967295 is strictly worse.
* Share validator between IR + binary-reader-interp (#1346)Ben Smith2020-02-271-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | The TypeChecker was already shared, but the rest of the other validation logic was duplicated. This change creates a SharedValidator which is used by both the Validator and the BinaryReaderInterp classes. The validator is structured similarly to TypeChecker as a collection of functions. It's assumed that the functions will be called in the same order as sections occur in the binary format. The IR valiator does this too, even though it's possible to validate components out-of-order in that case. This change also splits Module validation and Script validation into two different classes. It should have been written this way in the first place, and it's nice to do as part of this change since the module validator logic is mostly moved into the SharedValidator anyway. Next steps: * Remove all validation from BinaryReader and move it into the SharedValidator. * Move the TypeChecker into the SharedValidator (maybe not necessary) * Ensure that validation occurs before creating IR from binary (use SharedValidator in BinaryReaderIR? or maybe create BinaryReaderValidator passthru that both BinaryReaderIR and BinaryReaderInterp use?) * Rename Validator -> IRValidator, SharedValidator -> Validator
* Fix memory/table check to include imported+defined (#1336)Ben Smith2020-02-191-3/+2
|
* The great renaming (#985)Ben Smith2018-12-191-81/+1
| | | | | | | | This huge PR does all the renaming as described in issue #933. It also updates to the latest testsuite so the new names are used. The old names of the MVP instructions are still supported for convenience (though we should remove those too at some point), but the old simd and atomic instruction names are no longer supported.
* Update to the lastest spec testsuite (#953)Ben Smith2018-11-071-41/+41
|
* Update testsuite; enable mut. globals by default (#884)Ben Smith2018-08-031-68/+41
| | | | | | | | The newest testsuite update enables mutable globals by default, which matches the v1 WebAssembly spec. This change changes the default for all wabt tools, and changes the flag to `--disable-mutable-globals` in case you need the previous behavior. This flag will likely be removed in the future.
* Update spec tests; rename {grow,current}_memory (#849)Ben Smith2018-05-271-4/+4
| | | | | | | | | `grow_memory` -> `memory.grow` `current_memory` -> `memory.size` This could have been a smaller change, but I took the opportunity to rename the Token types, Expr types, and callback functions too. Many of these are sorted alphabetically, so I resorted based on their new names.
* Update testsuite (#780)Ben Smith2018-02-281-101/+68
| | | | * Fix edge case elem segment bounds checking * Fix bounds checking when importing spectest table
* Update testsuite (#757)Ben Smith2018-02-131-1/+1
| | | | | The spectest module's functions and globals are no longer overloaded, so their implementations in `spectest-interp` and `spec-wasm2c-prefix.c` have to be changed as well.
* Remove `run-interp.py`; use `RUN` commands instead (#730)Ben Smith2018-01-211-1/+0
| | | | | | Many of the `test/run-*` Python scripts are essentially the python equivalent of shell scripts. They require tedious maintenance whenever the tools change, and have a significant amount of copied code. This CL removes `run-interp.py` as a relatively simple initial example.
* Fix run-tests.py when STDIN_FILE is used > 1 times (#711)Ben Smith2018-01-091-79/+79
| | | | | | | | | | Each test should be run with its own directory of outputs, so the tests can be run in parallel without clobbering results. Since I added wasm2c, the spec `.wast` files were being used twice, but using the same output directory. This would often work properly in a full run, but was flaky, since they both write `.json` and `.wasm` files with the same names. This fix gives them their own directories by always using the directory name of the test.
* Use `.wat` extension for wast2json-generated files (#669)Ben Smith2017-11-131-20/+20
| | | Fixes #668.
* Add type check to data segment offset (#525)Sam Clegg2017-08-311-2/+1
| | | | | | This is a conservative check that we can do in the binary reader itself. More extensive checking is still done in the interpreter (i.e. vefiying the type of the global).
* Rewrite parser as recursive descent (#591)Ben Smith2017-08-151-80/+20
| | | | | | | | | | | | | | | | | | * Remove Bison dependency * Remove pre-generated parser files * Rename build config from no-re2c-bison to no-re2c * Add a simple make_unique implementation * Move handling of module bindings into ir.cc * Simplify lexer - Remove lookahead, the parser handles this now - Unify Token/LexerToken, it only contains terminal values now - Refactor setting token type and value into one function (e.g. LITERAL, RETURN => RETURN_LITERAL) * New Parser - Uses two tokens of lookahead (use Peek(0) or Peek(1)) - Consume() consumes one token of any kind - Match(t) consumes the current token if it matches - PeekMatch(t) returns true iff the token matches, but doesn't consume - Basic error synchronization; plenty of room for improvement here
* Remove BinaryErrorHandler, rename SourceErrorHandler (#553)Ben Smith2017-07-061-79/+79
| | | | | | | Since SourceErrorHandler can support binary locations, it doesn't make much sense to have two different error handlers. There is now only an ErrorHandler base class, and the first argument specifies whether the error handler is expecting text or binary locations.
* Update testsuite; more lexer/parser changes (#484)Ben Smith2017-06-111-1/+141
| | | | | | | | | | | | | | | | | | | | * Add support for quoted modules: `(module quote "...")` * Binary modules must be annotated: `(module binary "...")` * Multiple result blocks are no longer a parser error: `(func (result i32) (result i32) ...)` * Function types can specify unused bind variables: `(type (func (param $foo)))` * Rename `RawModule` -> `ScriptModule`. This encapsulates a module that may not be parsed yet, whether binary or "quoted". * Validate load/store offsets and alignment in the parser, not in the validator. The spec tests assume that you can catch these errors with `assert_malformed`. * Parse wast files in `wasm-interp` when checking malformed/invalid/etc. modules. This allows us to run all assertions at the same time, which is nice. `wasm-interp` should probably be renamed, though. * Two tests in `type.wast` fail because they use: `(assert_invalid (module quote "..."))`. I'd prefer that we don't support this, since it's unnecessary, and additional work. I'll fix in a follow-up CL if we decide this is worth keeping.
* Update testsuite to spec f1b89dfaf379060c7e35eb90b7daeb14d4ade3f7 (#392)Ben Smith2017-04-061-1/+1
|
* Use classes + virtual functions for BinaryReader (#376)Ben Smith2017-03-301-26/+26
| | | | | | | | | | | | | | | This adds a few new classes: * BinaryReader: the abstract base class * BinaryReaderNop: implements all of BinaryReader, but does nothing * BinaryReaderLogging: logs calls through BinaryReader, and forwards to another BinaryReader Typically this means we can remove the Context structs from these implementations, since that data can just move into the BinaryReader subclasses. I also took the opportunity to rename the new member functions to MixedCase instead of snake_case, since that's more common in C++.
* Remove assert_{invalid,malformed} checks from wast2wast (#296)Ben Smith2017-01-301-136/+0
| | | | | | | | Now that assert_invalid is checked by wasm-interp, all spec assertions can be handled by the interpreter. Having a subset that are also handled by wast2wasm is not useful. Also, there was a bug in the option parser where passing an option that didn't match could still work if a prefix was valid.
* Update testsuite (#297)Ben Smith2017-01-291-38/+47
|
* Implement assert_invalid for wasm-interp (#294)Ben Smith2017-01-271-1/+79
|
* Update testsuite (#291)Ben Smith2017-01-241-20/+29
| | | | | | | 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
* Update test/run-tests.py (#255)Ben Smith2017-01-051-37/+37
| | | | | * Write all intermediate output to out/ * Use real paths for all test names (i.e. include "test/") * A few Python3 fixes
* Update testsuite to f71cbe72bd5f4fb871bee39a9dc1278fa662a8a5Ben Smith2016-12-151-27/+67
|
* Update testsuiteBen Smith2016-12-091-53/+29
| | | | | | | * 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
* Implement assert_{malformed,unlinkable,uninstantiable}Ben Smith2016-12-061-3/+3
|
* Fix spec imports testBen Smith2016-11-071-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * Properly handle registering an unnamed module (most recently read) in AST parser * register command has optional name in spec JSON format * Implement spectest_import_{table,memory,global} * Implement on_register_command in wasm-interp (wires up module binding) * Implement assert_unlinkable * Set module's table_index and memory_index when importing table/memory * Translate {get,set}_global index from module -> environment index space * Don't close the environment's istream writer if the module read fails; this will destroy the output buffer. Just leave it as is, with extra unused data in the environment * Add registered_module_bindings hash; this has the registered name of the module (not to be confused with the module name, which is internal only) * Add {GET,SET}_GLOBAL opcodes to wasm_trace_pc and wasm_disassemble * Add new trap when calling a function via call_indirect, when the table element hasn't been initialized (via an elem segment) * Check the limits of tables + memories when importing * Check the function signature when importing * Use callback for printing errors from a host import; this lets us redirect the output the same way other errors are * Add environment "marks". Similar to allocator marks, allows you to backup to a previous state when an operation fails (such as successfully reading a module that was supposed to fail)
* Update testsuite and fix testsBen Smith2016-10-131-51/+35
| | | | | | | * `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`
* Fix most of the spec testsBen Smith2016-10-051-42/+86
| | | | | | | | | | | | | | | | | | | | | | | | | | The only ones that are failing are imports, exports, linking and start. Fixes: * Make sure to assign loc_ for WasmVar * Imports must occur before any definition, not just a definition of the same kind * Check that load/store alignment is not larger than natural alignment * Always check type stack at the end of the check_block; that way an empty block is still validated * Only allow one memory or table, including imports * Don't allow importing or exporting mutable globals * Loop label signature is for the fallthrough at the bottom, not the branch target. This was implemented properly in the AST checker, but not in binary-reader-interpreter * `top_type_is_any` will check if there is ANY anywhere on the type stack; previously this check did not look past the top label's type stack limit * `drop_types_for_return` may be called without having enough values on the type stack; for example, at the end of a function the ends with return * properly handle cleaning up the type stack for the interpreter when branching to the implicit function label * rename invoke -> action a few places
* passes all the spec testsBen Smith2016-09-291-40/+76
|
* fix the interp/ tests, move the spec tests outBen Smith2016-09-291-0/+61
| | | | | Mostly just requires proper implementation of drop/tee_local in wasm-binary-reader-interpreter.c and wasm-interpreter.c.
* remove JavaScript engine testing (#89)Ben Smith2016-06-171-61/+0
| | | | | It's not really the appropriate place to handle it. Now that we have wasm-wast and wasm-interp, we can at least verify that the tools are internally consistent.
* update spec testsBen Smith2016-05-181-11/+23
| | | | | | | | | * 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.
* update run-tests.py/other scripts for SM supportBen Smith2016-05-101-1/+1
|
* nicer overriding of various executables w/ testingBen Smith2016-03-211-2/+1
| | | | | | | | | * run-tests.py now takes a `--d8-executable` flag * Added a `TOOL` directive to tests to reduce boilerplate * Change all tests to use the new `TOOL` directive * Factor out executable searching with fallback to find_exe.py This fixes issue #43.
* update testsuite, fix spec testsBen Smith2016-03-081-17/+14
| | | | | spec/switch.txt is still failing because we don't yet support br_table passing an argument.
* rebase failing spec tests relying on page-sizeBen Smith2016-03-051-14/+17
| | | | Also allow TODO/NOTE directives in test file format.
* Change the memory sizes to be in units of pages rather than powers of two.Douglas Crosher2016-03-041-13/+13
|
* nicer errors for wasm-check tooBen Smith2016-02-261-0/+22
|
* remove "label" nodeBen Smith2015-12-301-6/+1
| | | | block nodes now always create a new scope