Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | [wasm-interp] Fix memory corruption with recursive call_indirect (#2464) | Soni L. | 2024-09-18 | 2 | -3/+4 |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The interpreter could overflow the stack without trapping properly in `call_indirect` situations. While it would set the `out_trap` to the trap reason, it would return `RunResult::Ok` and the interpreter code would only check `RunResult::Ok` to decide whether or not to keep running. In other words, while the stack overflow meant the interpreter wouldn't push a frame onto the call stack, the interpreter loop would continue advancing instructions, resulting in instructions after the runaway `call_indirect` running. If the offending `call_indirect` didn't have return values, it would be as if the call returned normally. If it did have return values, nothing would be pushed onto the value stack, yet the return types would be pushed onto the type stack. With careful manipulation of the following instructions, this could be used to cause all sorts of memory corruption. As it turns out, the function exit code, as well as a handful of other instructions, do check the state of the value and type stacks and can safely reproduce the bug without the memory corruption, so that's what we made the test do. The obvious fix was to make `call_indirect` propagate `RunResult::Trap` properly. Additionally, we made it so `assert_exhaustion` checks both the `RunResult` *and* the `out_trap`, and asserts if they don't match. This should help catch similar bugs in the future. Closes #2462 Fixes #2398 | ||||
* | wasm2c: Segue support for CPUs without wrgsbase instructions | Shravan Narayan | 2024-09-06 | 3 | -15/+63 |
| | |||||
* | Add missing relocation types (and delete a non-existent one) (#2457) | SingleAccretion | 2024-08-29 | 3 | -14/+39 |
| | |||||
* | Harden against invalid alignment (#2411) | Soni L. | 2024-08-09 | 2 | -18/+37 |
| | |||||
* | Fix parsing of malformed element section in text format (#2439) | Changqing Jing | 2024-07-12 | 1 | -1/+1 |
| | |||||
* | wasm2c: Segue optimization for modules with a single unshared memory (#2395) | Shravan Narayan | 2024-06-26 | 3 | -32/+233 |
| | |||||
* | Avoid creating temporary vector copies when checking signature (#2435) | Michael Bradshaw | 2024-06-24 | 1 | -1/+1 |
| | |||||
* | [wasm-objdump] Fix reporting of imported 64-bit tables (#2425) | Sam Clegg | 2024-05-22 | 1 | -0/+3 |
| | |||||
* | wasm2c: Use wabt::StripExtension (#2424) | Soni L | 2024-05-20 | 1 | -13/+3 |
| | | | Fixes #2423 | ||||
* | Update testsuite and implement table64 (#2418) | Sam Clegg | 2024-05-15 | 10 | -122/+191 |
| | | | | | See https://github.com/WebAssembly/memory64/issues/51 Includes workaround for #2422 | ||||
* | Fix bug in wasm2c's tail-call optimization code generation (#2420) | Christian Nieves | 2024-05-14 | 1 | -1/+1 |
| | |||||
* | Update testsuite and corresponding update to comment parser (#2416) | Sam Clegg | 2024-05-13 | 6 | -1070/+1079 |
| | | | | | | | The main change here is because `comments.wast` was updated to include a "quoted" module at the top level. Previously quoted modules had only been used as part of invalid or malformed assertion expressions. | ||||
* | Revert manual changes to src/prebuilt/lexer-keywords.cc. NFC (#2412) | Sam Clegg | 2024-05-03 | 2 | -13/+20 |
| | | | | | | This file is auto-generated but I had manually edited it #2091. Instead, disabled the clang fallthrough warnings when including this file. | ||||
* | Add macOS arm64 support and CI testing (#2406) | Soni L | 2024-03-26 | 2 | -0/+6 |
| | |||||
* | Add support for new WASM_SEGMENT_FLAG_RETAIN segment flag (#2399) | Yuta Saito | 2024-03-11 | 1 | -0/+4 |
| | | | See https://github.com/llvm/llvm-project/pull/81539 | ||||
* | Fix rot13 test on big-endian platforms (#2386) | Soni L | 2024-02-08 | 1 | -0/+11 |
| | |||||
* | wasm2c: Implement big-endian SIMD (#2340) | Soni L | 2024-02-06 | 3 | -73/+723 |
| | |||||
* | Remove unnecessary restriction (#2378) | Soni L | 2024-01-31 | 2 | -45/+37 |
| | | | | Thanks to MEM_ADDR we don't need to think about big-endian vs little-endian for any scalar(!) operations. | ||||
* | wasm2c: atomic and shared mem operations using c11 | Shravan Narayan | 2024-01-30 | 4 | -433/+466 |
| | |||||
* | Fix emscripten build warning and add missing export (#2367) | Changqing Jing | 2024-01-19 | 1 | -1/+1 |
| | |||||
* | Fix Features of wabt.post.js can't work in strict mode (#2365) | Changqing Jing | 2024-01-16 | 1 | -1/+1 |
| | |||||
* | Handle zero local count in disassembly (#2359) | Rod Vagg | 2024-01-03 | 1 | -5/+7 |
| | | | | Previously: local[0..4294967295] Current: local[] | ||||
* | wasm2c: Cleanup/separate code for heap and stack signal handlers | Shravan Narayan | 2023-12-14 | 2 | -2/+2 |
| | |||||
* | [wasm-objdump] set function types for correct params+locals indexing (#2353) | Rod Vagg | 2023-12-13 | 1 | -0/+8 |
| | |||||
* | WastParser: tighten parsing of folded `if` (#2349) | Keith Winstein | 2023-12-05 | 1 | -22/+13 |
| | | | | | This makes the `then` block mandatory per the spec, and parses multiple foldedinstrs in the `if` predicate (exercised by the new if.wast test). | ||||
* | [wasm-objdump] Print i64 values as unsigned (#2344) | Rod Vagg | 2023-12-01 | 1 | -1/+1 |
| | | | | | This matches the behaviour of i32 printing. Ref: https://github.com/WebAssembly/wabt/pull/2342 | ||||
* | Add support for new WASM_SYMBOL_ABS symbol flag (#2305) | Sam Clegg | 2023-11-28 | 1 | -3/+12 |
| | | | See https://github.com/llvm/llvm-project/pull/67493 | ||||
* | Update ID for tag name subsection (#2336) | Michael Williamson | 2023-11-27 | 2 | -0/+2 |
| | | | | | | | The tag name subsection currently has the speculative ID of 10. However, the extended-name-section proposal has now been updated to use an ID of 11 for the tag name section. This updates the NameSectionSubsection enum accordingly, as well as adding a field name section with the ID of 10. | ||||
* | decompiler.cc: fix vector oob when if has empty then (#2334) | Hyxogen | 2023-11-20 | 1 | -1/+4 |
| | |||||
* | wasm2c: Improve address abstraction for BE support (#2328) | Soni L | 2023-11-14 | 6 | -197/+177 |
| | |||||
* | Avoid use of `typeof` as argument name (#2314) | walkingeyerobot | 2023-10-26 | 1 | -2/+2 |
| | | | | While typeof is not a standard c++ keyword, it is in the gnu dialect (i.e. -std=gnu++17). Simply renaming typeof to typeoffunc and TypeOf to TypeOfFunc lets wabt be built with either dialect. | ||||
* | wasm2c: implement the tail-call proposal (#2272) | Keith Winstein | 2023-10-24 | 5 | -111/+587 |
| | |||||
* | feat: treat non-seekable files as pipes (#2309) | sethp | 2023-10-02 | 1 | -9/+13 |
| | | | | | | | | | | | | | | | Previously, attempting to read from a pipe would result in an error: 'not a regular file', disallowing use of files like /dev/stdin or /dev/fd/3, named fifos, sockets, etc. The tools already understand how to (try to) read from non-regular files, so this change attempts to do so when the input is not seek-able (the "regular file" capability that's in use here). Additionally, this adds a test for the new behavior using a bash herestring and process substitution (the latter of which shows up in argv as something like `/dev/fd/NN`). Since bash isn't commonly installed on Windows, this change also introduces a new capability to filter tests to specific platforms (sorry). | ||||
* | Rename wasm-opcodecnt to wasm-stats (#2298) | Soni L | 2023-09-19 | 2 | -8/+7 |
| | |||||
* | WastParser: replace CircularArray with internal TokenQueue (NFC) (#2300) | Keith Winstein | 2023-09-18 | 2 | -284/+32 |
| | |||||
* | Implement custom section reading/writing (#2284) | Diego Frias | 2023-09-15 | 8 | -1271/+1450 |
| | |||||
* | c-writer.cc: clean up some handling of typevector structs (NFC) (#2296) | Keith Winstein | 2023-09-15 | 1 | -10/+13 |
| | | | | | | - Only use "multivalue" to refer to a multi-value result type (not a tag type) - Deduplicate typevector struct declarations | ||||
* | Flip order of memory indexes on memory.copy (#2294) | Keith Winstein | 2023-09-11 | 12 | -30/+30 |
| | | | | Reflects change in the multi-memory proposal: https://github.com/WebAssembly/multi-memory/pull/29 | ||||
* | [wasm2c] Use wasm_rt_memcpy everywhere in generated code (#2292) | Sam Clegg | 2023-09-09 | 2 | -30/+30 |
| | |||||
* | Share reading/validation code between elem exprs & other const exprs (#2288) | Keith Winstein | 2023-09-06 | 12 | -160/+178 |
| | | | | | | This continues the work from #1783 and reduces special handling of elem exprs, by treating them the same as other const expressions (init expressions). | ||||
* | wasm2c: consolidate pack/unpack of tags & multi-value results (NFC) (#2286) | Keith Winstein | 2023-08-25 | 1 | -105/+84 |
| | |||||
* | Validator: normalize handling of Select in ExprVisitor Delegate (#2285) | Keith Winstein | 2023-08-23 | 1 | -5/+0 |
| | | | | | | | | | Fixes #2283 Previously, the OnSelectExpr delegate would terminate validation if the SharedValidator found an error in the expression, or if the Validator had previously found an error at any point in validating the module. This commit normalizes the behavior to match how the Validator handles other expression types. | ||||
* | wasm-strip: add `-R/--remove-section` option (#2282) | Diego Frias | 2023-08-18 | 1 | -2/+16 |
| | |||||
* | wat-writer.cc: resolve missing type index in call_indirect (#2278) | Keith Winstein | 2023-07-31 | 1 | -2/+10 |
| | |||||
* | c-writer.cc: clean up handling of functions & tags (NFC) (#2271) | Keith Winstein | 2023-07-31 | 1 | -49/+41 |
| | |||||
* | c-writer.cc: eliminate redundant import_syms_ SymbolSet (NFC) (#2275) | Keith Winstein | 2023-07-31 | 1 | -23/+16 |
| | |||||
* | decompiler.cc: passive data segments do not have offsets (#2163) | mannkdev | 2023-07-30 | 1 | -1/+5 |
| | |||||
* | wasm2c: add link to clang bug on mips force read constraint | Shravan Narayan | 2023-07-30 | 2 | -0/+3 |
| | |||||
* | wasm2c: ensure force read constraints compile for clang on mips | Shravan Narayan | 2023-07-30 | 6 | -62/+86 |
| | |||||
* | C++20 compatibility fixes | Shravan Narayan | 2023-07-02 | 2 | -7/+7 |
| |