diff --git a/.gitattributes b/.gitattributes index 6befbcf851..1262ed89c9 100644 --- a/.gitattributes +++ b/.gitattributes @@ -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 diff --git a/compiler/symtable.pas b/compiler/symtable.pas index 2538b03581..63705d6e65 100644 --- a/compiler/symtable.pas +++ b/compiler/symtable.pas @@ -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)); diff --git a/tests/webtbf/tw26456.pp b/tests/webtbf/tw26456.pp new file mode 100644 index 0000000000..fcc7abcea2 --- /dev/null +++ b/tests/webtbf/tw26456.pp @@ -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. +