mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-12 05:09:20 +02:00
* don't crash when parsing exit(xxx) in a constructor (mantis #23110)
git-svn-id: trunk@22795 -
This commit is contained in:
parent
6497d3c994
commit
1822c46d8a
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -12930,6 +12930,7 @@ tests/webtbs/tw2305.pp svneol=native#text/plain
|
||||
tests/webtbs/tw2306.pp svneol=native#text/plain
|
||||
tests/webtbs/tw2307.pp svneol=native#text/plain
|
||||
tests/webtbs/tw2311.pp svneol=native#text/plain
|
||||
tests/webtbs/tw23110.pp svneol=native#text/plain
|
||||
tests/webtbs/tw2317.pp svneol=native#text/plain
|
||||
tests/webtbs/tw2318.pp svneol=native#text/plain
|
||||
tests/webtbs/tw2318b.pp svneol=native#text/plain
|
||||
|
@ -306,8 +306,9 @@ implementation
|
||||
begin
|
||||
p1:=comp_expr(true,false);
|
||||
consume(_RKLAMMER);
|
||||
if (not assigned(current_procinfo) or
|
||||
is_void(current_procinfo.procdef.returndef)) then
|
||||
if not assigned(current_procinfo) or
|
||||
(current_procinfo.procdef.proctypeoption in [potype_constructor,potype_destructor]) or
|
||||
is_void(current_procinfo.procdef.returndef) then
|
||||
begin
|
||||
Message(parser_e_void_function);
|
||||
{ recovery }
|
||||
|
11
tests/webtbs/tw23110.pp
Normal file
11
tests/webtbs/tw23110.pp
Normal file
@ -0,0 +1,11 @@
|
||||
type TTest = object
|
||||
constructor Init;
|
||||
end;
|
||||
|
||||
constructor TTest.Init;
|
||||
begin
|
||||
exit (0);
|
||||
end;
|
||||
|
||||
begin
|
||||
end.
|
Loading…
Reference in New Issue
Block a user