2
0
Эх сурвалжийг харах

* avr: correctly write references to nil, resolves #32821

git-svn-id: trunk@37838 -
florian 7 жил өмнө
parent
commit
0f51cf8546

+ 1 - 0
.gitattributes

@@ -15916,6 +15916,7 @@ tests/webtbs/tw3272b.pp svneol=native#text/pascal
 tests/webtbs/tw3274.pp svneol=native#text/plain
 tests/webtbs/tw3280.pp svneol=native#text/plain
 tests/webtbs/tw3281.pp svneol=native#text/plain
+tests/webtbs/tw32821.pp svneol=native#text/pascal
 tests/webtbs/tw3286.pp svneol=native#text/plain
 tests/webtbs/tw3292.pp svneol=native#text/plain
 tests/webtbs/tw3294a.pp svneol=native#text/plain

+ 4 - 1
compiler/avr/agavrgas.pas

@@ -137,7 +137,10 @@ unit agavrgas;
                     else
                       s:='('+s+')';
                   end;
-                end;
+                end
+              { reference to address 0? }
+              else if not(assigned(symbol)) and (offset=0) then
+                s:='(0)';
             end;
           getreferencestring:=s;
         end;

+ 8 - 0
tests/webtbs/tw32821.pp

@@ -0,0 +1,8 @@
+{ %cpu=avr }
+program test;
+var
+  r0: byte absolute 0;
+begin
+  r0 := 128;
+end.
+