Commit 4cf36b6
authored
[EH] Make abort() work with Wasm EH (#16910)
We used to implement `abort()` with throwing a JS exception. #9730
changed it to `RuntimeError`, because it is the class a trap becomes
once it hits a JS frame.
But this turned out to be not working, because Wasm EH currently does
not assume all `RuntimeError`s are from traps; it decides whether a
`RuntimeError` is from a trap or not based on a hidden field within the
object. Relevant past discussion:
WebAssembly/exception-handling#89 (comment)
So at the moment we don't have a way of throwing a trap from JS, which
is inconvenient. I think we eventually want to make JS API for this, but
for the moment, this PR resorts to a wasm function that traps. This at
least makes calling `std::terminate` work. So far calling it exhausted
the call stack and aborted.1 parent 64034cf commit 4cf36b6
File tree
5 files changed
+36
-2
lines changed- src
- system/lib/compiler-rt
- tests
- tools
5 files changed
+36
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2570 | 2570 | | |
2571 | 2571 | | |
2572 | 2572 | | |
| 2573 | + | |
| 2574 | + | |
| 2575 | + | |
2573 | 2576 | | |
2574 | 2577 | | |
2575 | 2578 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
605 | 605 | | |
606 | 606 | | |
607 | 607 | | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
608 | 613 | | |
609 | 614 | | |
610 | 615 | | |
611 | 616 | | |
612 | 617 | | |
613 | | - | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
614 | 622 | | |
615 | 623 | | |
616 | 624 | | |
| |||
621 | 629 | | |
622 | 630 | | |
623 | 631 | | |
| 632 | + | |
624 | 633 | | |
625 | 634 | | |
626 | 635 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1655 | 1655 | | |
1656 | 1656 | | |
1657 | 1657 | | |
| 1658 | + | |
| 1659 | + | |
| 1660 | + | |
| 1661 | + | |
| 1662 | + | |
| 1663 | + | |
| 1664 | + | |
| 1665 | + | |
| 1666 | + | |
| 1667 | + | |
| 1668 | + | |
| 1669 | + | |
| 1670 | + | |
| 1671 | + | |
| 1672 | + | |
| 1673 | + | |
| 1674 | + | |
| 1675 | + | |
1658 | 1676 | | |
1659 | 1677 | | |
1660 | 1678 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
708 | 708 | | |
709 | 709 | | |
710 | 710 | | |
711 | | - | |
| 711 | + | |
| 712 | + | |
712 | 713 | | |
713 | 714 | | |
714 | 715 | | |
| |||
0 commit comments