wasm-micro-runtime/core/iwasm/interpreter
Yi Liu 539bebed9c
Fix missing IS_INVALID_TAGINDEX check in RETHROW handler (#4837)
* Fix RETHROW handler missing IS_INVALID_TAGINDEX check

Add validation for exception_tag_index in the RETHROW opcode handler
to prevent out-of-bounds access to module->module->tags[] when the
tag index is INVALID_TAGINDEX (0xFFFFFFFF). This matches the existing
check in the THROW handler.

When CATCH_ALL catches a cross-module exception with an unknown tag,
it pushes INVALID_TAGINDEX onto the stack. Without this check, a
subsequent RETHROW would access tags[0xFFFFFFFF].

* Fix incorrect code section byte counts in exception handling test

The hand-crafted WASM binary in load_module_with_exception_handling had
an off-by-one in the code section: body size was declared as 7 but the
actual body (local count + try/catch_all/end/end) is only 6 bytes.
This caused the WASM loader to fail with "unexpected end" when it tried
to read past the available bytes.

Fix the body size from 7 to 6 and the code section size from 9 to 8.
2026-03-09 10:04:18 +08:00
..
iwasm_interp.cmake Implement wasm mini loader and refine footprint of loader and runtime (#276) 2020-06-08 11:19:09 +08:00
SConscript add porting codes of rt-thread (#494) 2021-01-14 11:26:35 +08:00
wasm_interp_classic.c Fix missing IS_INVALID_TAGINDEX check in RETHROW handler (#4837) 2026-03-09 10:04:18 +08:00
wasm_interp_fast.c Fix memcpy overlap issue in RECOVER_BR_INFO for i64/v128 copy (#4797) 2026-01-26 09:59:34 +08:00
wasm_interp.h Calculate func_index instead of adding an extra field to wasm frame 2025-01-28 11:09:32 +00:00
wasm_loader.c workaround: prevent usage of anyref in struct fields and array elements (#4819) 2026-03-03 13:05:44 +08:00
wasm_loader.h Enhance wasm loading with LoadArgs and support module names (#3265) 2024-04-07 15:04:35 +08:00
wasm_mini_loader.c fix code and comment typo (#4802) 2026-01-26 14:44:47 +08:00
wasm_opcode.h Merge commit from fork 2025-11-24 14:37:46 +08:00
wasm_runtime.c fix: clear exec_env_tls when destroying exec_env (#4774) 2026-01-20 07:09:26 +08:00
wasm_runtime.h Pass InstantiationArgs2 down to aot_instantiate/wasm_instantiate (#4594) 2025-10-23 15:57:50 +08:00
wasm.h add a set of apis to configure wasi via InstantiationArgs2 (#4707) 2025-11-24 19:20:21 +08:00