Explorar el Código

* remove type case when loading constant in tattreader.BuildConstantOperand, resolves #33202, should not hurt other targets

git-svn-id: trunk@38307 -
florian hace 7 años
padre
commit
d16a22e42b
Se han modificado 3 ficheros con 12 adiciones y 1 borrados
  1. 1 0
      .gitattributes
  2. 1 1
      compiler/raatt.pas
  3. 10 0
      tests/webtbs/tw33202.pp

+ 1 - 0
.gitattributes

@@ -16011,6 +16011,7 @@ tests/webtbs/tw33086.pp svneol=native#text/pascal
 tests/webtbs/tw3309.pp svneol=native#text/plain
 tests/webtbs/tw33098.pp svneol=native#text/pascal
 tests/webtbs/tw3320.pp svneol=native#text/plain
+tests/webtbs/tw33202.pp svneol=native#text/pascal
 tests/webtbs/tw3324.pp svneol=native#text/plain
 tests/webtbs/tw3327.pp svneol=native#text/plain
 tests/webtbs/tw3328.pp svneol=native#text/plain

+ 1 - 1
compiler/raatt.pas

@@ -1723,7 +1723,7 @@ unit raatt;
         else
          begin
            oper.opr.typ:=OPR_CONSTANT;
-           oper.opr.val:=aint(l);
+           oper.opr.val:=l;
          end;
       end;
 

+ 10 - 0
tests/webtbs/tw33202.pp

@@ -0,0 +1,10 @@
+{ %CPU=avr }
+{ %OPT=-Sm }
+program macrotest;
+const
+  sramMax = FPC_SRAMBASE + FPC_SRAMSIZE - 1;
+begin
+  asm
+    sts sramMax , r31 // macrotest.pp(13,16) Error: Constant value out of bounds
+  end;
+end.