mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-07 17:26:14 +02:00
* if a pointer_to_array type conversion is applied to a variable, it is not written, resolves #39957
This commit is contained in:
parent
27315ac528
commit
1c86a4bbeb
@ -3775,7 +3775,8 @@ implementation
|
|||||||
|
|
||||||
procedure Ttypeconvnode.mark_write;
|
procedure Ttypeconvnode.mark_write;
|
||||||
begin
|
begin
|
||||||
left.mark_write;
|
if not(convtype=tc_pointer_2_array) then
|
||||||
|
left.mark_write;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function ttypeconvnode.first_cord_to_pointer : tnode;
|
function ttypeconvnode.first_cord_to_pointer : tnode;
|
||||||
|
9
tests/webtbs/tw39957.pp
Normal file
9
tests/webtbs/tw39957.pp
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
{ %opt=-O4 -Oodeadstore -Oonoregvar }
|
||||||
|
var
|
||||||
|
src: array[0 .. 9] of int32;
|
||||||
|
srcp: pInt32;
|
||||||
|
|
||||||
|
begin
|
||||||
|
srcp := pInt32(src);
|
||||||
|
srcp[0] := 1;
|
||||||
|
end.
|
Loading…
Reference in New Issue
Block a user