Jelajahi Sumber

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

Jonas Maebe 5 tahun lalu
induk
melakukan
b625afe800
4 mengubah file dengan 13 tambahan dan 2 penghapusan
  1. 3 1
      compiler/globtype.pas
  2. 1 0
      compiler/ninl.pas
  3. 6 0
      compiler/psub.pas
  4. 3 1
      compiler/utils/ppuutils/ppudump.pp

+ 3 - 1
compiler/globtype.pas

@@ -746,7 +746,9 @@ interface
          { set if the procedure has generated data which shall go in an except table }
          { set if the procedure has generated data which shall go in an except table }
          pi_has_except_table_data,
          pi_has_except_table_data,
          { subroutine needs to load and maintain a tls register }
          { 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;
        tprocinfoflags=set of tprocinfoflag;
 
 

+ 1 - 0
compiler/ninl.pas

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

+ 6 - 0
compiler/psub.pas

@@ -208,6 +208,12 @@ implementation
             exit;
             exit;
           end;
           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
         for i:=0 to procdef.paras.count-1 do
           begin
           begin
             currpara:=tparavarsym(procdef.paras[i]);
             currpara:=tparavarsym(procdef.paras[i]);

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

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