Commit d124ba1
authored
[EH] Fix __get_exception_message for multiple virtual inheritance (#26946)
This fixes `__get_exception_message` so it works with multiple virtual
inheritance. #24008 tried to fix this, but the test case there didn't
`virtual` in the line where the inheritance happens.
In case of dependent exceptions (= the exceptions thrown by
`std::rethrow_exception`), we should not even dereference
`thrown_object`, because it doesn't contain anything. #24008 ran
`can_catch` on the currect primary exception but before that it called
`can_catch` on the dependent exception first, which caused the memory
error. #24008's test case was fine because it didn't have `virtual`, we
didn't have to dereference `thrown_object` (`adjustedPtr` in this
method) directly:
https://github.com/emscripten-core/emscripten/blob/b2e19a341ac53b33de3aae7b4ea7bf7168ebace7/system/lib/libcxxabi/src/private_typeinfo.cpp#L572-L579
This computes the primary exception pointer first and then call
`can_catch`.
Fixes #26771.1 parent b2e19a3 commit d124ba1
2 files changed
Lines changed: 27 additions & 24 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
88 | | - | |
89 | | - | |
| 88 | + | |
90 | 89 | | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
100 | 95 | | |
101 | 96 | | |
| 97 | + | |
| 98 | + | |
102 | 99 | | |
103 | 100 | | |
104 | 101 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8742 | 8742 | | |
8743 | 8743 | | |
8744 | 8744 | | |
8745 | | - | |
| 8745 | + | |
| 8746 | + | |
8746 | 8747 | | |
8747 | | - | |
8748 | | - | |
8749 | | - | |
| 8748 | + | |
| 8749 | + | |
| 8750 | + | |
| 8751 | + | |
8750 | 8752 | | |
8751 | | - | |
8752 | | - | |
| 8753 | + | |
| 8754 | + | |
8753 | 8755 | | |
8754 | 8756 | | |
8755 | 8757 | | |
| 8758 | + | |
8756 | 8759 | | |
8757 | | - | |
| 8760 | + | |
8758 | 8761 | | |
8759 | | - | |
8760 | | - | |
8761 | | - | |
8762 | | - | |
8763 | | - | |
| 8762 | + | |
| 8763 | + | |
| 8764 | + | |
| 8765 | + | |
| 8766 | + | |
| 8767 | + | |
| 8768 | + | |
8764 | 8769 | | |
| 8770 | + | |
8765 | 8771 | | |
8766 | 8772 | | |
8767 | 8773 | | |
8768 | | - | |
| 8774 | + | |
8769 | 8775 | | |
8770 | 8776 | | |
8771 | 8777 | | |
| |||
0 commit comments