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

Merged revisions 649 via svnmerge from
/trunk

git-svn-id: branches/fixes_2_0@692 -

peter 20 жил өмнө
parent
commit
4ffb2dde15

+ 1 - 0
.gitattributes

@@ -5974,6 +5974,7 @@ tests/webtbs/tw4151.pp svneol=native#text/plain
 tests/webtbs/tw4152.pp svneol=native#text/plain
 tests/webtbs/tw4155.pp svneol=native#text/plain
 tests/webtbs/tw4162.pp svneol=native#text/plain
+tests/webtbs/tw4173.pp svneol=native#text/plain
 tests/webtbs/tw4188.pp svneol=native#text/plain
 tests/webtbs/ub1873.pp svneol=native#text/plain
 tests/webtbs/ub1883.pp svneol=native#text/plain

+ 4 - 0
compiler/symtype.pas

@@ -759,6 +759,7 @@ implementation
              sl_load,
              sl_subscript :
                hp^.sym:=tsym(hp^.symderef.resolve);
+             sl_absolutetype,
              sl_typeconv :
                hp^.tt.resolve;
              sl_vec :
@@ -784,6 +785,7 @@ implementation
              sl_load,
              sl_subscript :
                hp^.symderef.build(hp^.sym);
+             sl_absolutetype,
              sl_typeconv :
                hp^.tt.buildderef;
              sl_vec :
@@ -1234,6 +1236,7 @@ implementation
                 getderef(symderef);
                 p.addsymderef(slt,symderef);
               end;
+            sl_absolutetype,
             sl_typeconv :
               begin
                 gettype(tt);
@@ -1398,6 +1401,7 @@ implementation
              sl_load,
              sl_subscript :
                putderef(hp^.symderef);
+             sl_absolutetype,
              sl_typeconv :
                puttype(hp^.tt);
              sl_vec :

+ 55 - 0
tests/webtbs/tw4173.pp

@@ -0,0 +1,55 @@
+{ Source provided for Free Pascal Bug Report 4173 }
+{ Submitted by "Gerhard" on  2005-07-11 }
+{ e-mail: [email protected] }
+{
+  operator with a redefine by ABSOLUTE on its result var
+  produces the internal error 200110205;
+  only when operator is defined in a unit.
+}
+
+
+{$define nok} { if this is defined, the operator with problem is compiled }
+{ $define ok}  { if this is defined, the operator without problem is compiled }
+
+unit tw4173 ;
+
+interface
+
+  type
+    tbcd = record something : integer end ;
+    tbcdx = record something : integer end ;
+
+{$ifdef nok}
+  operator := ( const bcd : tbcd ) z : comp ; inline ;
+{$endif}
+
+{$ifdef ok}
+  operator := ( const bcd : tbcdx ) z : comp ; inline ;
+{$endif}
+
+implementation
+
+{$ifdef nok}
+  operator := ( const bcd : tbcd ) z : comp ; inline ;
+
+    var
+      zz : int64 absolute z ;
+
+    begin
+     end ;
+{$endif}
+
+{$ifdef ok}
+  operator := ( const bcd : tbcdx ) z : comp ; inline ;
+
+    var
+      zz : int64 ;
+      zzz : comp absolute zz ;
+
+    begin
+      zz := 3 ;
+      z := zzz ;
+     end ;
+{$endif}
+
+end.