Browse Source

* support sl_absolutetype in deref

git-svn-id: trunk@649 -
peter 20 years ago
parent
commit
3eba03f77b
3 changed files with 60 additions and 0 deletions
  1. 1 0
      .gitattributes
  2. 4 0
      compiler/symtype.pas
  3. 55 0
      tests/webtbs/tw4173.pp

+ 1 - 0
.gitattributes

@@ -6143,6 +6143,7 @@ tests/webtbs/tw4151.pp svneol=native#text/plain
 tests/webtbs/tw4152.pp svneol=native#text/plain
 tests/webtbs/tw4152.pp svneol=native#text/plain
 tests/webtbs/tw4155.pp svneol=native#text/plain
 tests/webtbs/tw4155.pp svneol=native#text/plain
 tests/webtbs/tw4162.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/tw4188.pp svneol=native#text/plain
 tests/webtbs/tw4199.pp svneol=native#text/plain
 tests/webtbs/tw4199.pp svneol=native#text/plain
 tests/webtbs/ub1873.pp svneol=native#text/plain
 tests/webtbs/ub1873.pp svneol=native#text/plain

+ 4 - 0
compiler/symtype.pas

@@ -777,6 +777,7 @@ implementation
              sl_load,
              sl_load,
              sl_subscript :
              sl_subscript :
                hp^.sym:=tsym(hp^.symderef.resolve);
                hp^.sym:=tsym(hp^.symderef.resolve);
+             sl_absolutetype,
              sl_typeconv :
              sl_typeconv :
                hp^.tt.resolve;
                hp^.tt.resolve;
              sl_vec :
              sl_vec :
@@ -802,6 +803,7 @@ implementation
              sl_load,
              sl_load,
              sl_subscript :
              sl_subscript :
                hp^.symderef.build(hp^.sym);
                hp^.symderef.build(hp^.sym);
+             sl_absolutetype,
              sl_typeconv :
              sl_typeconv :
                hp^.tt.buildderef;
                hp^.tt.buildderef;
              sl_vec :
              sl_vec :
@@ -1252,6 +1254,7 @@ implementation
                 getderef(symderef);
                 getderef(symderef);
                 p.addsymderef(slt,symderef);
                 p.addsymderef(slt,symderef);
               end;
               end;
+            sl_absolutetype,
             sl_typeconv :
             sl_typeconv :
               begin
               begin
                 gettype(tt);
                 gettype(tt);
@@ -1416,6 +1419,7 @@ implementation
              sl_load,
              sl_load,
              sl_subscript :
              sl_subscript :
                putderef(hp^.symderef);
                putderef(hp^.symderef);
+             sl_absolutetype,
              sl_typeconv :
              sl_typeconv :
                puttype(hp^.tt);
                puttype(hp^.tt);
              sl_vec :
              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.