فهرست منبع

Move explicit typecast to after check to avoid RTE when compiled with -CR

git-svn-id: trunk@47367 -
pierre 4 سال پیش
والد
کامیت
3d374727dd
2فایلهای تغییر یافته به همراه2 افزوده شده و 2 حذف شده
  1. 1 1
      compiler/aarch64/aoptcpu.pas
  2. 1 1
      compiler/arm/aoptcpu.pas

+ 1 - 1
compiler/aarch64/aoptcpu.pas

@@ -85,11 +85,11 @@ Implementation
     var
       p: taicpu;
     begin
-      p := taicpu(hp);
       Result := false;
       if not ((assigned(hp)) and (hp.typ = ait_instruction)) then
         exit;
 
+      p := taicpu(hp);
       case p.opcode of
         { These operands do not write into a register at all }
         A_CMP, A_CMN, A_TST, A_B, A_BL, A_MSR, A_FCMP:

+ 1 - 1
compiler/arm/aoptcpu.pas

@@ -220,11 +220,11 @@ Implementation
     var
       p: taicpu;
     begin
-      p := taicpu(hp);
       Result := false;
       if not ((assigned(hp)) and (hp.typ = ait_instruction)) then
         exit;
 
+      p := taicpu(hp);
       case p.opcode of
         { These operands do not write into a register at all }
         A_CMP, A_CMN, A_TST, A_TEQ, A_B, A_BL, A_BX, A_BLX, A_SWI, A_MSR, A_PLD,