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

git-svn-id: trunk@16487 -
This commit is contained in:
paul 2010-12-01 04:33:47 +00:00
parent c9c1179b00
commit ba75daa50d
3 changed files with 23 additions and 2 deletions

1
.gitattributes vendored
View File

@ -10660,6 +10660,7 @@ tests/webtbs/tw16034.pp svneol=native#text/plain
tests/webtbs/tw16040.pp svneol=native#text/plain
tests/webtbs/tw16065.pp svneol=native#text/pascal
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/tw16108.pp svneol=native#text/plain
tests/webtbs/tw16130.pp svneol=native#text/pascal

View File

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

21
tests/webtbs/tw16090.pp Normal file
View File

@ -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.