tinycc-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Tinycc-devel] [PATCH] arm-asm: Raise error if user tries to use PC for


From: Danny Milosavljevic
Subject: [Tinycc-devel] [PATCH] arm-asm: Raise error if user tries to use PC for offset register of single data transfer
Date: Tue, 12 Jan 2021 18:00:29 +0100

---
 arm-asm.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arm-asm.c b/arm-asm.c
index 7a3d2e2..285ec5e 100644
--- a/arm-asm.c
+++ b/arm-asm.c
@@ -1016,6 +1016,10 @@ static void asm_single_data_transfer_opcode(TCCState 
*s1, int token)
         }
         parse_operand(s1, &ops[2]);
         if (ops[2].type == OP_REG32) {
+            if (ops[2].reg == 15) {
+                tcc_error("Using 'pc' for register offset in '%s' is not 
implemented by ARM", get_tok_str(token, NULL));
+                return;
+            }
             if (tok == ',') {
                 next();
                 opcode |= asm_parse_optional_shift(s1, &nb_shift, &shift);



reply via email to

[Prev in Thread] Current Thread [Next in Thread]