* never inline routines that call get_frame (otherwise get_frame would return

the frame of the caller rather than of the current routine, which could
    cause e.g. stackframes to be missed in RTL helpers that are known to be
    only called from run time error routines)

git-svn-id: trunk@44064 -
This commit is contained in:
Jonas Maebe 2020-01-29 22:21:14 +00:00
parent 08f9ec98e5
commit b625afe800
4 changed files with 13 additions and 2 deletions

View File

@ -746,7 +746,9 @@ interface
{ set if the procedure has generated data which shall go in an except table }
pi_has_except_table_data,
{ subroutine needs to load and maintain a tls register }
pi_needs_tls
pi_needs_tls,
{ subroutine uses get_frame }
pi_uses_get_frame
);
tprocinfoflags=set of tprocinfoflag;

View File

@ -4471,6 +4471,7 @@ implementation
function tinlinenode.first_get_frame: tnode;
begin
include(current_procinfo.flags,pi_needs_stackframe);
include(current_procinfo.flags,pi_uses_get_frame);
expectloc:=LOC_CREGISTER;
result:=nil;
end;

View File

@ -208,6 +208,12 @@ implementation
exit;
end;
if pi_uses_get_frame in current_procinfo.flags then
begin
_no_inline('get_frame');
exit;
end;
for i:=0 to procdef.paras.count-1 do
begin
currpara:=tparavarsym(procdef.paras[i]);

View File

@ -1628,7 +1628,9 @@ const
(mask:pi_has_except_table_data;
str:' has except table data '),
(mask:pi_needs_tls;
str:' uses TLS data pointer ')
str:' uses TLS data pointer '),
(mask:pi_uses_get_frame;
str:' uses get_frame')
);
var
procinfooptions : tprocinfoflags;