aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* section.c: Remove debug logHEADmasterXavier Del Campo Romero2026-02-161-1/+0
| | | | | This call to nwp_log was only meant for debugging purposes during early versions of the library.
* Add i32.xorXavier Del Campo Romero2025-11-154-1/+26
|
* Add select operatorXavier Del Campo Romero2025-11-155-1/+132
|
* Check memory linear accesses are within boundsXavier Del Campo Romero2025-11-155-2/+56
| | | | | | | | | WebAssembly defines how many pages of linear memory are owned by the instance on startup. This limit can then be bumped via the grow_memory operator. Therefore, accesses outside the defined bounds are considered an exception.
* Add br_tableXavier Del Campo Romero2025-11-1510-10/+121
| | | | | | | | | br_table is in fact a generalization of other branch types like br or br_if, since br_table contains several branches for the same pc inside the nw_lo section. Therefore, this kind of branch forced some changes to nwp_break and those relying on it.
* Add nwp_type_strXavier Del Campo Romero2025-11-153-0/+30
| | | | | This private function allows to decode an enum nw_type to a human-readable string.
* Add i32.shr_{s,u}Xavier Del Campo Romero2025-11-135-2/+52
|
* call_import.c: Fix prev_retXavier Del Campo Romero2025-11-121-2/+8
| | | | | | | So far, this variable was only being assigned by unwind.c, which is called only for WebAssembly functions. However, it is still mandatory to report the last returned value from imported functions, too, as prev_ret is relied upon by operators such as `drop`.
* execute.c: Report exception also on repeated callbackXavier Del Campo Romero2025-11-121-1/+11
| | | | | | So far, exceptions coming from the pc callback were only being reported on its first call. However, pc callbacks might assign a continuation callback if the operation cannot be completed on a single call.
* Fix prev_opXavier Del Campo Romero2025-11-123-3/+6
| | | | | | | | Assigning prev_op inside nwp_execute defeated the purpose because this function is meant to start the state machine for the given instruction. In other words, inspecting prev_op would in fact return the current opcode, instead of the previous opcode.
* Add i32_{gt,le}_{s,u}Xavier Del Campo Romero2025-11-127-4/+104
|
* Do not explicitly initialize static variables to zeroXavier Del Campo Romero2025-11-1011-11/+11
| | | | This is redundant according to the C standard.
* Add current_memory and grow_memory operatorsXavier Del Campo Romero2025-11-106-2/+169
|
* Add if and else operatorsXavier Del Campo Romero2025-11-109-13/+104
|
* Add i32.lt_uXavier Del Campo Romero2025-11-094-1/+26
|
* Add i32.shlXavier Del Campo Romero2025-11-094-1/+26
|
* call_import.c: Always set ci->pcXavier Del Campo Romero2025-11-091-2/+2
| | | | | | Otherwise, imports without parameters would jump to `call` directly without assigning ci->pc first, so that nwp_interp_resume would read incorrectly from offset 0.
* types.h: Formatting changesXavier Del Campo Romero2025-11-091-1/+1
|
* br_if.c: Consider both MSB and LSB for i64Xavier Del Campo Romero2025-11-071-1/+1
| | | | | Otherwise, values such as 0x100000000 (i.e., the 32th-bit is set) would not cause a branch because only the lower 32 bits would be tested.
* set_local.c: Fix set_param to valid nextXavier Del Campo Romero2025-11-071-1/+1
| | | | | | | | | | | set_local is meant to write a local variable, while allowing the use of a caller-defined callback when finished. While this was already correctly implemented by set_local, set_param was incorrectly calling nwp_interp_resume instead of the caller-defined callback. This had the side effect of tee_local not being able to push the value into the stack when the local index referred to a parameter, thus causing undefined behaviour.
* Add i32_store8Xavier Del Campo Romero2025-11-065-1/+94
|
* First commitXavier Del Campo Romero2025-11-06186-0/+14162