mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-09 00:08:12 +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;
|
||||
begin
|
||||
left.mark_write;
|
||||
if not(convtype=tc_pointer_2_array) then
|
||||
left.mark_write;
|
||||
end;
|
||||
|
||||
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