Ver código fonte

compiler: set moduleid for record symtables and descendants (fixes bug #0017950)

git-svn-id: trunk@16351 -
paul 14 anos atrás
pai
commit
d99b4ae7c1
4 arquivos alterados com 41 adições e 0 exclusões
  1. 2 0
      .gitattributes
  2. 1 0
      compiler/symtable.pas
  3. 9 0
      tests/webtbs/tw17950.pp
  4. 29 0
      tests/webtbs/uw17950.pas

+ 2 - 0
.gitattributes

@@ -10751,6 +10751,7 @@ tests/webtbs/tw17907/unit2/unit0002.pas svneol=native#text/plain
 tests/webtbs/tw1792.pp svneol=native#text/plain
 tests/webtbs/tw17928.pp svneol=native#text/plain
 tests/webtbs/tw1792a.pp svneol=native#text/plain
+tests/webtbs/tw17950.pp svneol=native#text/pascal
 tests/webtbs/tw1798.pp svneol=native#text/plain
 tests/webtbs/tw1820.pp svneol=native#text/plain
 tests/webtbs/tw1825.pp svneol=native#text/plain
@@ -11600,6 +11601,7 @@ tests/webtbs/uw15909.pp svneol=native#text/plain
 tests/webtbs/uw17220.pp svneol=native#text/plain
 tests/webtbs/uw17220a.pp svneol=native#text/plain
 tests/webtbs/uw17493.pp svneol=native#text/plain
+tests/webtbs/uw17950.pas svneol=native#text/pascal
 tests/webtbs/uw2004.inc svneol=native#text/plain
 tests/webtbs/uw2040.pp svneol=native#text/plain
 tests/webtbs/uw2266a.inc svneol=native#text/plain

+ 1 - 0
compiler/symtable.pas

@@ -752,6 +752,7 @@ implementation
     constructor tabstractrecordsymtable.create(const n:string;usealign:shortint);
       begin
         inherited create(n);
+        moduleid:=current_module.moduleid;
         _datasize:=0;
         databitsize:=0;
         recordalignment:=1;

+ 9 - 0
tests/webtbs/tw17950.pp

@@ -0,0 +1,9 @@
+program tw17950;
+{$mode delphi}
+
+// checks visibility of nested class fields
+
+uses
+  uw17950;
+begin
+end.

+ 29 - 0
tests/webtbs/uw17950.pas

@@ -0,0 +1,29 @@
+unit uw17950; 
+
+{$mode delphi}
+
+interface
+
+implementation
+
+type
+  TFoo1 = class;
+
+  TFoo1 = class
+  public
+    type
+      TFoo2 = object
+      private
+        FField2: integer;
+      end;
+    public
+      function GetFoo2: TFoo2;
+  end;
+
+function TFoo1.GetFoo2: TFoo2;
+begin
+  result.FField2 := 5;
+end;
+
+end.
+