Browse Source

compiler: change find_module_from_symtable to support not only unit symtables but also other symtables with valid moduleid (fixes bug #0016090)

git-svn-id: trunk@16487 -
paul 14 years ago
parent
commit
ba75daa50d
3 changed files with 23 additions and 2 deletions
  1. 1 0
      .gitattributes
  2. 1 2
      compiler/fmodule.pas
  3. 21 0
      tests/webtbs/tw16090.pp

+ 1 - 0
.gitattributes

@@ -10660,6 +10660,7 @@ tests/webtbs/tw16034.pp svneol=native#text/plain
 tests/webtbs/tw16040.pp svneol=native#text/plain
 tests/webtbs/tw16040.pp svneol=native#text/plain
 tests/webtbs/tw16065.pp svneol=native#text/pascal
 tests/webtbs/tw16065.pp svneol=native#text/pascal
 tests/webtbs/tw16083.pp svneol=native#text/plain
 tests/webtbs/tw16083.pp svneol=native#text/plain
+tests/webtbs/tw16090.pp svneol=native#text/pascal
 tests/webtbs/tw16100.pp svneol=native#text/pascal
 tests/webtbs/tw16100.pp svneol=native#text/pascal
 tests/webtbs/tw16108.pp svneol=native#text/plain
 tests/webtbs/tw16108.pp svneol=native#text/plain
 tests/webtbs/tw16130.pp svneol=native#text/pascal
 tests/webtbs/tw16130.pp svneol=native#text/pascal

+ 1 - 2
compiler/fmodule.pas

@@ -257,8 +257,7 @@ implementation
         hp:=tmodule(loaded_units.first);
         hp:=tmodule(loaded_units.first);
         while assigned(hp) do
         while assigned(hp) do
           begin
           begin
-            if (hp.globalsymtable=st) or
-               (hp.localsymtable=st) then
+            if (hp.moduleid=st.moduleid) then
               begin
               begin
                 result:=hp;
                 result:=hp;
                 exit;
                 exit;

+ 21 - 0
tests/webtbs/tw16090.pp

@@ -0,0 +1,21 @@
+{ %norun }
+
+program tw16090;
+
+{$mode objfpc}{$H+}
+
+type
+  TClass1 = class
+  public type
+    generic TNestedClass<T> = class
+    end;
+    // Fatal: Internal error 200705152
+    TSpecialization1 = specialize TNestedClass<Integer>;
+  end;
+
+  // Fatal: Internal error 200705152
+  TSpecialization1 = specialize TClass1.TNestedClass<Integer>;
+
+begin
+end.
+