فهرست منبع

* check if current_procinfo is assigned in paramanager code to avoid crashes

git-svn-id: trunk@23303 -
florian 12 سال پیش
والد
کامیت
7ac9f11cc7
2فایلهای تغییر یافته به همراه9 افزوده شده و 2 حذف شده
  1. 5 1
      compiler/powerpc/cpupara.pas
  2. 4 1
      compiler/powerpc64/cpupara.pas

+ 5 - 1
compiler/powerpc/cpupara.pas

@@ -530,7 +530,11 @@ unit cpupara;
                        else
                          begin
                            paraloc^.reference.index:=NR_R12;
-                           tppcprocinfo(current_procinfo).needs_frame_pointer := true;
+
+                           { create_paraloc_info_intern might be also called when being outside of
+                             code generation so current_procinfo might be not set }
+                           if assigned(current_procinfo) then
+                             tppcprocinfo(current_procinfo).needs_frame_pointer := true;
                          end;
 
                        if not((target_info.system in systems_aix) and

+ 4 - 1
compiler/powerpc64/cpupara.pas

@@ -427,7 +427,10 @@ begin
         else begin
           { during procedure entry, NR_OLD_STACK_POINTER_REG contains the old stack pointer }
           paraloc^.reference.index := NR_OLD_STACK_POINTER_REG;
-          tppcprocinfo(current_procinfo).needs_frame_pointer := true;
+          { create_paraloc_info_intern might be also called when being outside of
+            code generation so current_procinfo might be not set }
+          if assigned(current_procinfo) then
+            tppcprocinfo(current_procinfo).needs_frame_pointer := true;
         end;
         paraloc^.reference.offset := stack_offset;