Commit 9fd2966
committed
[Mips] Fix clang crashes when assembling invalid MIPS beql instructions with --arch=mips
From clang version 4, mips append new instruction BeqImm and
BEQLImm, the second operand format of instruction is imm64:$imm.
1.When Mips process `beql $t0, ($t0), 1`, it think the second operand
was an imm, so match success. Then mips backend process expandBranchImm,
check the second operand `$t0` was not imm, reported asserts.
We can strengthen the second operand matching restrictions.
2.Similarly, when Mips process `beql $t0, (1), 1`, it think the second
was an imm. so match success. Then mips backend process expandBranchImm,
check the third operand `1` was not expression, reported asserts. Permit
the third operand of `beql` to be imm.
Fix #151453.1 parent bf2f241 commit 9fd2966
File tree
3 files changed
+22
-4
lines changed- llvm
- lib/Target/Mips
- AsmParser
- test/MC/Mips
3 files changed
+22
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3677 | 3677 | | |
3678 | 3678 | | |
3679 | 3679 | | |
3680 | | - | |
| 3680 | + | |
3681 | 3681 | | |
3682 | 3682 | | |
3683 | 3683 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
857 | 857 | | |
858 | 858 | | |
859 | 859 | | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
| 868 | + | |
| 869 | + | |
860 | 870 | | |
861 | 871 | | |
862 | 872 | | |
| |||
2949 | 2959 | | |
2950 | 2960 | | |
2951 | 2961 | | |
2952 | | - | |
| 2962 | + | |
2953 | 2963 | | |
2954 | 2964 | | |
2955 | | - | |
| 2965 | + | |
2956 | 2966 | | |
2957 | 2967 | | |
2958 | 2968 | | |
| |||
2980 | 2990 | | |
2981 | 2991 | | |
2982 | 2992 | | |
2983 | | - | |
| 2993 | + | |
2984 | 2994 | | |
2985 | 2995 | | |
2986 | 2996 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
3 | 11 | | |
4 | 12 | | |
5 | 13 | | |
| |||
0 commit comments