Commit 84ea5d3
authored
wasm-interp: Fix catch handlers' value stack sizes (#2478)
Fixes the value stack size of the catch handler. There were two
(related) issues here:
- The previous code used `func_->locals.size()` as soon as the function
was available, but it hadn't processed the function's locals yet, so it
was always empty. (This might not matter in practice, as it's only used
by the "function-wide catch handler", which just rethrows.)
- The previous code didn't take the function's locals into account when
computing the value stack height (relative to the function frame) for a
try-catch block. So, it would drop the locals when catching an
exception.
Closes #2476
(Split from #2470 )1 parent 790bc04 commit 84ea5d3
File tree
2 files changed
+36
-8
lines changed- src/interp
- test/regress
2 files changed
+36
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
831 | 831 | | |
832 | 832 | | |
833 | 833 | | |
834 | | - | |
835 | | - | |
836 | | - | |
837 | | - | |
838 | | - | |
839 | | - | |
840 | | - | |
841 | 834 | | |
842 | 835 | | |
843 | 836 | | |
| |||
856 | 849 | | |
857 | 850 | | |
858 | 851 | | |
| 852 | + | |
| 853 | + | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
| 857 | + | |
| 858 | + | |
| 859 | + | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
859 | 863 | | |
860 | 864 | | |
861 | 865 | | |
| |||
1516 | 1520 | | |
1517 | 1521 | | |
1518 | 1522 | | |
1519 | | - | |
| 1523 | + | |
| 1524 | + | |
| 1525 | + | |
1520 | 1526 | | |
1521 | 1527 | | |
1522 | 1528 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
0 commit comments