History

arm-asm: Raise an error if asm_binary_opcode is used with PC as operand

Danny Milosavljevic committed 5 years ago

Commit 67b402f1 parent 3a6f3e51 file · +10 −0Browse files

Unified · Split

arm-asm.c+10−0
@@ -217,11 +217,21 @@ static void asm_binary_opcode(TCCState *s1, int token) · 216 unmodified lines
217 return;217 return;
218 }218 }
219 219
220 if (ops[0].reg == 15) {
221 tcc_error("'%s' does not support 'pc' as operand", get_tok_str(token, NULL));
222 return;
223 }
224
220 if (ops[1].type != OP_REG32) {225 if (ops[1].type != OP_REG32) {
221 expect("(source operand) register");226 expect("(source operand) register");
222 return;227 return;
223 }228 }
224 229
230 if (ops[1].reg == 15) {
231 tcc_error("'%s' does not support 'pc' as operand", get_tok_str(token, NULL));
232 return;
233 }
234
225 if (tok == ',') {235 if (tok == ',') {
226 next(); // skip ','236 next(); // skip ','
227 if (tok == TOK_ASM_ror) {237 if (tok == TOK_ASM_ror) {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t