* GetEnumName handles subrange types correctly, resolves #15377

git-svn-id: trunk@14461 -
This commit is contained in:
florian 2009-12-22 11:36:47 +00:00
parent 04f0544570
commit 8cecea9b53
3 changed files with 24 additions and 9 deletions

1
.gitattributes vendored
View File

@ -10149,6 +10149,7 @@ tests/webtbs/tw15304.pp svneol=native#text/plain
tests/webtbs/tw1532.pp svneol=native#text/plain
tests/webtbs/tw15364.pp svneol=native#text/plain
tests/webtbs/tw15370.pp svneol=native#text/plain
tests/webtbs/tw15377.pp svneol=native#text/pascal
tests/webtbs/tw1539.pp svneol=native#text/plain
tests/webtbs/tw1567.pp svneol=native#text/plain
tests/webtbs/tw1573.pp svneol=native#text/plain

View File

@ -375,6 +375,7 @@ begin
else
begin
PS:=@PT^.NameList;
dec(Value,PT^.MinValue);
While Value>0 Do
begin
PS:=PShortString(pointer(PS)+PByte(PS)^+1);

13
tests/webtbs/tw15377.pp Normal file
View File

@ -0,0 +1,13 @@
program test;
uses typinfo;
Type
E1 = (en1,en2,en3,en4,en5);
E2 = en3..en5;
begin
if (GetEnumName(TypeInfo(E1),Ord(High(E1))) <> 'en5') then
halt(1);
if (GetEnumName(TypeInfo(E2),Ord(High(E2))) <> 'en5') then
halt(1);
end.