Commit c0d3e1e
committed
fix(runtime): clear exec_env_tls on early return from stack overflow check
Move the fix to clear exec_env_tls at the source - in the early return
path of invoke_native_with_hw_bound_check when native stack overflow
check fails.
Changes:
- aot_runtime.c: Clear exec_env_tls before early return on stack overflow
- wasm_runtime.c: Clear exec_env_tls before early return on stack overflow
- Remove defensive fix from wasm_exec_env_destroy (no longer needed)
- Move test from standalone to unit tests (runtime-common)
The bug: When wasm_runtime_call_wasm sets exec_env_tls but returns early
due to native stack overflow check failure, TLS was not cleared. This
caused subsequent calls with a different exec_env to fail with
"invalid exec env" error.1 parent 9f73f59 commit c0d3e1e
6 files changed
Lines changed: 92 additions & 491 deletions
File tree
- core/iwasm
- aot
- common
- interpreter
- tests
- standalone/test-exec-env-tls
- unit/runtime-common
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2485 | 2485 | | |
2486 | 2486 | | |
2487 | 2487 | | |
| 2488 | + | |
2488 | 2489 | | |
2489 | 2490 | | |
2490 | 2491 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
199 | 199 | | |
200 | 200 | | |
201 | 201 | | |
202 | | - | |
203 | | - | |
204 | | - | |
205 | | - | |
206 | | - | |
207 | | - | |
208 | | - | |
209 | | - | |
210 | | - | |
211 | | - | |
212 | | - | |
213 | | - | |
214 | | - | |
215 | | - | |
216 | 202 | | |
217 | 203 | | |
218 | 204 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3618 | 3618 | | |
3619 | 3619 | | |
3620 | 3620 | | |
| 3621 | + | |
3621 | 3622 | | |
3622 | 3623 | | |
3623 | 3624 | | |
| |||
This file was deleted.
0 commit comments