mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-16 09:34:12 +02:00
* leave parse_proc_head() (with some error recovery) if the interface could not be found instead of running straight into an access violation
+ added test git-svn-id: trunk@35007 -
This commit is contained in:
parent
a4e9a6d6e4
commit
3f77ce3b12
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -10419,6 +10419,7 @@ tests/tbf/tb0251.pp svneol=native#text/pascal
|
|||||||
tests/tbf/tb0252a.pp svneol=native#text/plain
|
tests/tbf/tb0252a.pp svneol=native#text/plain
|
||||||
tests/tbf/tb0252b.pp svneol=native#text/plain
|
tests/tbf/tb0252b.pp svneol=native#text/plain
|
||||||
tests/tbf/tb0252c.pp svneol=native#text/plain
|
tests/tbf/tb0252c.pp svneol=native#text/plain
|
||||||
|
tests/tbf/tb0253.pp svneol=native#text/pascal
|
||||||
tests/tbf/ub0115.pp svneol=native#text/plain
|
tests/tbf/ub0115.pp svneol=native#text/plain
|
||||||
tests/tbf/ub0149.pp svneol=native#text/plain
|
tests/tbf/ub0149.pp svneol=native#text/plain
|
||||||
tests/tbf/ub0158a.pp svneol=native#text/plain
|
tests/tbf/ub0158a.pp svneol=native#text/plain
|
||||||
|
@ -878,7 +878,14 @@ implementation
|
|||||||
(ttypesym(srsym).typedef.typ=objectdef) then
|
(ttypesym(srsym).typedef.typ=objectdef) then
|
||||||
ImplIntf:=find_implemented_interface(tobjectdef(astruct),tobjectdef(ttypesym(srsym).typedef));
|
ImplIntf:=find_implemented_interface(tobjectdef(astruct),tobjectdef(ttypesym(srsym).typedef));
|
||||||
if ImplIntf=nil then
|
if ImplIntf=nil then
|
||||||
Message(parser_e_interface_id_expected)
|
begin
|
||||||
|
Message(parser_e_interface_id_expected);
|
||||||
|
{ error recovery }
|
||||||
|
consume(_ID);
|
||||||
|
if try_to_consume(_EQ) then
|
||||||
|
consume(_ID);
|
||||||
|
exit;
|
||||||
|
end
|
||||||
else
|
else
|
||||||
{ in case of a generic or specialized interface we need to use the
|
{ in case of a generic or specialized interface we need to use the
|
||||||
name of the def instead of the symbol, so that always the correct
|
name of the def instead of the symbol, so that always the correct
|
||||||
|
14
tests/tbf/tb0253.pp
Normal file
14
tests/tbf/tb0253.pp
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
{ %FAIL }
|
||||||
|
|
||||||
|
program tb0253;
|
||||||
|
|
||||||
|
{$mode objfpc}
|
||||||
|
|
||||||
|
type
|
||||||
|
TTest = class(TObject, IInterface)
|
||||||
|
procedure Blubb.Bar = Foo;
|
||||||
|
end;
|
||||||
|
|
||||||
|
begin
|
||||||
|
|
||||||
|
end.
|
Loading…
Reference in New Issue
Block a user