mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-21 13:49:29 +02:00
* properly process all child nodes of call nodes in foreachnode, resolves #40957
This commit is contained in:
parent
431d4395ea
commit
b8a4a72760
@ -243,6 +243,7 @@ implementation
|
||||
result := foreachnode(procmethod,tnode(tcallnode(n).callinitblock),f,arg) or result;
|
||||
result := foreachnode(procmethod,tcallnode(n).methodpointer,f,arg) or result;
|
||||
result := foreachnode(procmethod,tcallnode(n).funcretnode,f,arg) or result;
|
||||
result := foreachnode(procmethod,tnode(tcallnode(n).vmt_entry),f,arg) or result;
|
||||
result := foreachnode(procmethod,tnode(tcallnode(n).callcleanupblock),f,arg) or result;
|
||||
end;
|
||||
callparan:
|
||||
@ -351,6 +352,7 @@ implementation
|
||||
result := foreachnodestatic(procmethod,tnode(tcallnode(n).callinitblock),f,arg) or result;
|
||||
result := foreachnodestatic(procmethod,tcallnode(n).methodpointer,f,arg) or result;
|
||||
result := foreachnodestatic(procmethod,tcallnode(n).funcretnode,f,arg) or result;
|
||||
result := foreachnodestatic(procmethod,tnode(tcallnode(n).vmt_entry),f,arg) or result;
|
||||
result := foreachnodestatic(procmethod,tnode(tcallnode(n).callcleanupblock),f,arg) or result;
|
||||
end;
|
||||
callparan:
|
||||
|
32
tests/webtbs/tw40957.pp
Normal file
32
tests/webtbs/tw40957.pp
Normal file
@ -0,0 +1,32 @@
|
||||
program i20241020_01;
|
||||
{$mode objfpc}
|
||||
|
||||
//{$OPTIMIZATION NODFA}
|
||||
//{$OPTIMIZATION NOFORLOOP}
|
||||
|
||||
type
|
||||
TObj = object
|
||||
arr: array [0..512] of byte;
|
||||
constructor init;
|
||||
destructor done; virtual;
|
||||
end;
|
||||
|
||||
const
|
||||
cnt=44;
|
||||
|
||||
var
|
||||
arr: array[0..cnt] of TObj;
|
||||
i: int32;
|
||||
|
||||
constructor TObj.init;
|
||||
begin
|
||||
end;
|
||||
|
||||
destructor TObj.done;
|
||||
begin
|
||||
end;
|
||||
|
||||
begin
|
||||
for i:=0 to cnt do arr[i].init;
|
||||
for i:=0 to cnt do arr[i].done; // AV here in run-time
|
||||
end.
|
Loading…
Reference in New Issue
Block a user