소스 검색

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,