wasm-micro-runtime/core/iwasm
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
..
aot Fix off-by-one in aot_alloc_tiny_frame overflow check (#4845) 2026-03-03 13:48:42 +08:00
common windows: fix vectored exception handler lifecycle for repeated thread env init/destroy (#4842) 2026-02-27 08:20:44 +08:00
compilation Fix potential memory leak when discarding FreeMachineFunction (#4796) 2026-01-21 11:02:33 +08:00
doc Fix some more spelling issues (#3393) 2024-05-08 09:30:29 +08:00
fast-jit add micro AMR_BUILD_LIME1 to enable minimal lime1 feature set (#4571) 2025-09-14 14:08:27 +08:00
include fix: WASM_API_EXTERN should get visibility("default") on gcc and clang (#4851) 2026-02-27 08:18:44 +08:00
interpreter Fix missing IS_INVALID_TAGINDEX check in RETHROW handler (#4837) 2026-03-09 10:04:18 +08:00
libraries clean(zephyr): reduce warnings on zephyr platform (#4860) 2026-03-05 08:58:04 +08:00
README.md Add architecture diagram for wasm globals and classic-interp stack frame (#2058) 2023-03-25 09:39:20 +08:00