Browse Source

Use aint type local variable in read_index_shift to avoid wrong typecast

git-svn-id: trunk@19576 -
pierre 13 years ago
parent
commit
3a7af29d3a
1 changed files with 5 additions and 2 deletions
  1. 5 2
      compiler/arm/raarmgas.pas

+ 5 - 2
compiler/arm/raarmgas.pas

@@ -212,6 +212,8 @@ Unit raarmgas;
 
 
       procedure read_index_shift(require_rbracket : boolean);
+        var
+          shift : aint;
         begin
           case actasmtoken of
             AS_COMMA :
@@ -227,9 +229,10 @@ Unit raarmgas;
                         if not(actasmtoken=AS_HASH) then
                           do_error;
                         Consume(AS_HASH);
-                        oper.opr.ref.shiftimm := BuildConstExpression(false,true);
-                        if (oper.opr.ref.shiftimm<0) or (oper.opr.ref.shiftimm>32) then
+                        shift := BuildConstExpression(false,true);
+                        if (shift<0) or (shift>32) then
                           do_error;
+                        oper.opr.ref.shiftimm := shift;
                         test_end(require_rbracket);
                       end;
                    end