Commit b9a52b6
committed
fix(M68K): fix cross-arch bugs in cpush/cinv and dc.w printing
build_cpush_cinv: use op1->reg instead of op1->imm for address
register operand. Writing to imm (uint64_t) when reg (m68k_reg,
uint32_t) is read back causes garbage values on big-endian targets
(PPC64, s390x) due to union byte order mismatch.
M68K_printInst: cast imm to uint32_t before passing to PRIx32
format. Passing uint64_t to a PRIx32 format specifier is UB; on
32-bit big-endian MIPS the high word (0) is read instead of the
low word containing the instruction bytes.
Fixes cstest details failures on QEMU Linux PPC64, s390x, Mips32.1 parent cbf8a9e commit b9a52b6
2 files changed
Lines changed: 33 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
102 | | - | |
| 102 | + | |
| 103 | + | |
103 | 104 | | |
104 | 105 | | |
105 | 106 | | |
| |||
1246 | 1247 | | |
1247 | 1248 | | |
1248 | 1249 | | |
1249 | | - | |
| 1250 | + | |
1250 | 1251 | | |
1251 | 1252 | | |
1252 | 1253 | | |
| |||
3600 | 3601 | | |
3601 | 3602 | | |
3602 | 3603 | | |
3603 | | - | |
3604 | | - | |
3605 | | - | |
3606 | | - | |
| 3604 | + | |
| 3605 | + | |
| 3606 | + | |
| 3607 | + | |
| 3608 | + | |
| 3609 | + | |
| 3610 | + | |
| 3611 | + | |
| 3612 | + | |
| 3613 | + | |
| 3614 | + | |
| 3615 | + | |
3607 | 3616 | | |
3608 | 3617 | | |
3609 | 3618 | | |
| |||
3680 | 3689 | | |
3681 | 3690 | | |
3682 | 3691 | | |
3683 | | - | |
| 3692 | + | |
| 3693 | + | |
3684 | 3694 | | |
3685 | 3695 | | |
3686 | 3696 | | |
| |||
3751 | 3761 | | |
3752 | 3762 | | |
3753 | 3763 | | |
3754 | | - | |
3755 | | - | |
3756 | | - | |
| 3764 | + | |
| 3765 | + | |
| 3766 | + | |
| 3767 | + | |
| 3768 | + | |
| 3769 | + | |
| 3770 | + | |
| 3771 | + | |
| 3772 | + | |
3757 | 3773 | | |
3758 | 3774 | | |
3759 | 3775 | | |
| |||
3864 | 3880 | | |
3865 | 3881 | | |
3866 | 3882 | | |
3867 | | - | |
3868 | | - | |
| 3883 | + | |
| 3884 | + | |
| 3885 | + | |
| 3886 | + | |
| 3887 | + | |
| 3888 | + | |
3869 | 3889 | | |
3870 | 3890 | | |
3871 | 3891 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
383 | 383 | | |
384 | 384 | | |
385 | 385 | | |
386 | | - | |
| 386 | + | |
387 | 387 | | |
388 | 388 | | |
389 | 389 | | |
| |||
0 commit comments