mirror of
git://repo.or.cz/tinycc.git
synced 2026-06-26 14:54:19 +08:00
arm-asm: Raise an error if asm_binary_opcode is used with PC as operand
This commit is contained in:
parent
3a6f3e5f30
commit
67b402fda4
10
arm-asm.c
10
arm-asm.c
@ -217,11 +217,21 @@ static void asm_binary_opcode(TCCState *s1, int token)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (ops[0].reg == 15) {
|
||||||
|
tcc_error("'%s' does not support 'pc' as operand", get_tok_str(token, NULL));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (ops[1].type != OP_REG32) {
|
if (ops[1].type != OP_REG32) {
|
||||||
expect("(source operand) register");
|
expect("(source operand) register");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (ops[1].reg == 15) {
|
||||||
|
tcc_error("'%s' does not support 'pc' as operand", get_tok_str(token, NULL));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (tok == ',') {
|
if (tok == ',') {
|
||||||
next(); // skip ','
|
next(); // skip ','
|
||||||
if (tok == TOK_ASM_ror) {
|
if (tok == TOK_ASM_ror) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user