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
217217 return;
218218 }
219219
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+
220225 if (ops[1].type != OP_REG32) {
221226 expect("(source operand) register");
222227 return;
223228 }
224229
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+
225235 if (tok == ',') {
226236 next(); // skip ','
227237 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