* don't throw an internal error if a procedure is passed to a const formal parameter, resolves #40817

This commit is contained in:
florian 2024-06-13 22:32:22 +02:00
parent 558704f91c
commit 8b2ebd07bf
2 changed files with 13 additions and 1 deletions

View File

@ -1828,7 +1828,7 @@ implementation
blockn,
calln :
begin
if (hp.nodetype=calln) or
if ((hp.nodetype=calln) and not(is_void(hp.resultdef))) or
(nf_no_lvalue in hp.flags) then
begin
{ Temp strings are stored in memory, for compatibility with

12
tests/webtbf/tw40817.pp Normal file
View File

@ -0,0 +1,12 @@
{ %fail ]
procedure proc;
begin
end;
procedure test(const o);
begin
end;
begin
test(proc); // project1.lpr(10,3) Error: Internal error 2011010304
end.