- disable inlining of routines that contain a call to a C-style varargs

function, as we don't save/restore the synthetic paravarsyms that
    are created for this

git-svn-id: trunk@29584 -
This commit is contained in:
Jonas Maebe 2015-01-30 19:31:22 +00:00
parent fde6448063
commit eb419b58c5
4 changed files with 13 additions and 2 deletions

View File

@ -617,7 +617,9 @@ interface
{ allocates memory on stack, so stack is unbalanced on exit }
pi_has_stack_allocs,
{ set if the stack frame of the procedure is estimated }
pi_estimatestacksize
pi_estimatestacksize,
{ the routine calls a C-style varargs function }
pi_calls_c_varargs
);
tprocinfoflags=set of tprocinfoflag;

View File

@ -2837,6 +2837,7 @@ implementation
end;
if (i>0) then
begin
include(current_procinfo.flags,pi_calls_c_varargs);
varargsparas:=tvarargsparalist.create;
pt:=tcallparanode(left);
while assigned(pt) do

View File

@ -155,6 +155,12 @@ implementation
Message(parser_h_inlining_disabled);
exit;
end;
if pi_calls_c_varargs in current_procinfo.flags then
begin
Message1(parser_h_not_supported_for_inline,'called C-style varargs functions');
Message(parser_h_inlining_disabled);
exit;
end;
{ the compiler cannot handle inherited in inlined subroutines because
it tries to search for self in the symtable, however, the symtable
is not available }

View File

@ -1266,7 +1266,9 @@ const
(mask:pi_has_stack_allocs;
str:' allocates memory on stack, so stack may be unbalanced on exit '),
(mask:pi_estimatestacksize;
str:' stack size is estimated before subroutine is compiled ')
str:' stack size is estimated before subroutine is compiled '),
(mask:pi_calls_c_varargs;
str:' calls function with C-style varargs ')
);
var
procinfooptions : tprocinfoflags;