Commit f5ea49a
authored
Fix missing unreachable checks in Heap2Local visitStructRMW/visitStructCmpxchg (WebAssembly#8304)
## Summary
`visitStructRMW` and `visitStructCmpxchg` in `Struct2Local` are missing
the `Type::unreachable` guard that all sibling visitor methods have
(`visitRefGetDesc`, `visitStructGet`, `visitRefIsNull`, `visitRefEq`).
When a `struct.atomic.rmw` or `struct.atomic.rmw.cmpxchg` has an
unreachable operand (e.g., unreachable value), the expression type is
`unreachable` but the code asserts it equals the concrete field type,
causing an assertion failure:
```
Assertion failed: (type == field.type), function visitStructRMW, file Heap2Local.cpp, line 1043.
```
This is the same bug pattern that was fixed in WebAssembly#8283 for
`visitRefGetDesc` — it was just missed in these two methods.1 parent aebfa3c commit f5ea49a
File tree
2 files changed
+67
-0
lines changed- src/passes
- test/lit/passes
2 files changed
+67
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1038 | 1038 | | |
1039 | 1039 | | |
1040 | 1040 | | |
| 1041 | + | |
| 1042 | + | |
| 1043 | + | |
| 1044 | + | |
| 1045 | + | |
1041 | 1046 | | |
1042 | 1047 | | |
1043 | 1048 | | |
| |||
1108 | 1113 | | |
1109 | 1114 | | |
1110 | 1115 | | |
| 1116 | + | |
| 1117 | + | |
| 1118 | + | |
| 1119 | + | |
| 1120 | + | |
1111 | 1121 | | |
1112 | 1122 | | |
1113 | 1123 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
693 | 693 | | |
694 | 694 | | |
695 | 695 | | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
696 | 753 | | |
0 commit comments