* fix loading of enum subranges from ppu

git-svn-id: trunk@535 -
This commit is contained in:
peter 2005-06-30 07:13:42 +00:00
parent 26c69e89dc
commit 627a3b53e8
4 changed files with 44 additions and 0 deletions

2
.gitattributes vendored
View File

@ -6101,6 +6101,7 @@ tests/webtbs/tw4078.pp svneol=native#text/plain
tests/webtbs/tw4089.pp svneol=native#text/plain
tests/webtbs/tw4093.pp svneol=native#text/plain
tests/webtbs/tw4115.pp svneol=native#text/plain
tests/webtbs/tw4140.pp svneol=native#text/plain
tests/webtbs/ub1873.pp svneol=native#text/plain
tests/webtbs/ub1883.pp svneol=native#text/plain
tests/webtbs/uw0555.pp svneol=native#text/plain
@ -6136,6 +6137,7 @@ tests/webtbs/uw3356.pp svneol=native#text/plain
tests/webtbs/uw3429.pp svneol=native#text/plain
tests/webtbs/uw3474a.pp svneol=native#text/plain
tests/webtbs/uw3474b.pp svneol=native#text/plain
tests/webtbs/uw4140.pp svneol=native#text/plain
utils/Makefile svneol=native#text/plain
utils/Makefile.fpc svneol=native#text/plain
utils/README -text

View File

@ -684,6 +684,7 @@ interface
procedure ppuwrite(ppufile:tcompilerppufile);override;
procedure buildderef;override;
procedure deref;override;
procedure derefimpl;override;
function gettypename:string;override;
function is_publishable : boolean;override;
procedure calcsavesize;
@ -1785,6 +1786,18 @@ implementation
end;
procedure tenumdef.derefimpl;
begin
if assigned(basedef) and
(firstenum=nil) then
begin
firstenum:=basedef.firstenum;
while assigned(firstenum) and (tenumsym(firstenum).value<>minval) do
firstenum:=tenumsym(firstenum).nextenum;
end;
end;
destructor tenumdef.destroy;
begin
inherited destroy;

18
tests/webtbs/tw4140.pp Executable file
View File

@ -0,0 +1,18 @@
{ %recompile }
unit tw4140;
interface
implementation
uses uw4140;
procedure Foo;
var Enum: TMySubEnum;
begin
{ Any of two lines below causes "Internal error 309993" }
Writeln(Ord(Low(TMySubEnum)));
Writeln(Ord(Low(Enum)));
end;
end.

11
tests/webtbs/uw4140.pp Executable file
View File

@ -0,0 +1,11 @@
unit uw4140;
interface
type
TMyEnum = (meOne, meTwo, meThree);
TMySubEnum = meOne .. meTwo;
implementation
end.