Răsfoiți Sursa

- 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 -

Jonas Maebe 10 ani în urmă
părinte
comite
eb419b58c5
4 a modificat fișierele cu 13 adăugiri și 2 ștergeri
  1. 3 1
      compiler/globtype.pas
  2. 1 0
      compiler/ncal.pas
  3. 6 0
      compiler/psub.pas
  4. 3 1
      compiler/utils/ppuutils/ppudump.pp

+ 3 - 1
compiler/globtype.pas

@@ -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;
 

+ 1 - 0
compiler/ncal.pas

@@ -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

+ 6 - 0
compiler/psub.pas

@@ -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 }

+ 3 - 1
compiler/utils/ppuutils/ppudump.pp

@@ -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;