Browse Source

* don't crash on thumb instructions with only two operands when optimizing ADD, SUB, AND statements

git-svn-id: trunk@23272 -
florian 12 years ago
parent
commit
ff98d2567c
1 changed files with 2 additions and 0 deletions
  1. 2 0
      compiler/arm/aoptcpu.pas

+ 2 - 0
compiler/arm/aoptcpu.pas

@@ -1074,6 +1074,7 @@ Implementation
                           ...
                         }
                     if (taicpu(p).opcode = A_AND) and
+                       (taicpu(p).ops>2) and
                        (taicpu(p).oper[1]^.typ = top_reg) and
                        (taicpu(p).oper[2]^.typ = top_const) then
                       begin
@@ -1133,6 +1134,7 @@ Implementation
                       str/ldr reg3,[reg1,const2+/-const1]
                     }
                     if (taicpu(p).opcode in [A_ADD,A_SUB]) and
+                       (taicpu(p).ops>2) and
                        (taicpu(p).oper[1]^.typ = top_reg) and
                        (taicpu(p).oper[2]^.typ = top_const) then
                       begin