Fix for Mantis #26456.

symtable.pas, searchsym_in_helper:
  * check whether extendeddef is assigned as this function is called when parsing the extended type and it was not found (the second pass is to display a more accurate error message and was added some weeks ago)

+ added test

git-svn-id: trunk@28242 -
This commit is contained in:
svenbarth 2014-07-20 13:40:01 +00:00
parent 2fdb701f9a
commit f1bfb398e4
3 changed files with 20 additions and 1 deletions

1
.gitattributes vendored
View File

@ -12774,6 +12774,7 @@ tests/webtbf/tw26176.pp svneol=native#text/pascal
tests/webtbf/tw26193.pp svneol=native#text/pascal
tests/webtbf/tw26363.pp svneol=native#text/plain
tests/webtbf/tw26363a.pp svneol=native#text/plain
tests/webtbf/tw26456.pp svneol=native#text/pascal
tests/webtbf/tw2650.pp svneol=native#text/plain
tests/webtbf/tw2657.pp svneol=native#text/plain
tests/webtbf/tw2670.pp svneol=native#text/plain

View File

@ -2926,7 +2926,9 @@ implementation
end;
end;
{ now search in the extended type itself }
if classh.extendeddef.typ in [recorddef,objectdef] then
{ Note: the extendeddef might be Nil if we are currently parsing the
extended type itself and the identifier was not found }
if assigned(classh.extendeddef) and (classh.extendeddef.typ in [recorddef,objectdef]) then
begin
srsymtable:=tabstractrecorddef(classh.extendeddef).symtable;
srsym:=tsym(srsymtable.FindWithHash(hashedid));

16
tests/webtbf/tw26456.pp Normal file
View File

@ -0,0 +1,16 @@
{ %FAIL }
program tw26456;
{$modeswitch advancedrecords}
type
THelper = record helper for xxxxxxx
procedure test;
end;
procedure THelper.test;
begin
end;
begin
end.