mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-27 19:10:14 +02:00
* don't throw an internalerror in case of an illegal assignment to an open array, resolves #40662
This commit is contained in:
parent
9c5bfbeb78
commit
3cf7890352
@ -722,7 +722,11 @@ implementation
|
|||||||
|
|
||||||
{ assignments to formaldefs and open arrays aren't allowed }
|
{ assignments to formaldefs and open arrays aren't allowed }
|
||||||
if is_open_array(left.resultdef) then
|
if is_open_array(left.resultdef) then
|
||||||
CGMessage(type_e_assignment_not_allowed)
|
begin
|
||||||
|
CGMessage(type_e_assignment_not_allowed);
|
||||||
|
result:=cerrornode.create;
|
||||||
|
exit;
|
||||||
|
end
|
||||||
else if (left.resultdef.typ=formaldef) then
|
else if (left.resultdef.typ=formaldef) then
|
||||||
if not(target_info.system in systems_managed_vm) then
|
if not(target_info.system in systems_managed_vm) then
|
||||||
CGMessage(type_e_assignment_not_allowed)
|
CGMessage(type_e_assignment_not_allowed)
|
||||||
|
11
tests/webtbf/tw40662.pp
Normal file
11
tests/webtbf/tw40662.pp
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
{ %fail }
|
||||||
|
program test;
|
||||||
|
|
||||||
|
procedure proc(var values: array of string);
|
||||||
|
begin
|
||||||
|
values := ['hi']; // project1.lpr(5,10) Error: Assignments to formal parameters and open arrays are not possible
|
||||||
|
// project1.lpr(5,13) Error: Internal error 99080501
|
||||||
|
end;
|
||||||
|
|
||||||
|
begin
|
||||||
|
end.
|
Loading…
Reference in New Issue
Block a user