소스 검색

Use a temporary variable to avoid potential problems of overwriting the argument.

git-svn-id: trunk@33119 -
Jeppe Johansen 9 년 전
부모
커밋
03d4ada29e
1개의 변경된 파일5개의 추가작업 그리고 3개의 파일을 삭제
  1. 5 3
      rtl/arm/arm.inc

+ 5 - 3
rtl/arm/arm.inc

@@ -1130,10 +1130,12 @@ end;
   generates a perfect 4 cycle code sequence and can be inlined.
 }
 function SwapEndian(const AValue: LongWord): LongWord;{$ifdef SYSTEMINLINE}inline;{$endif}
+var
+  Temp: LongWord;
 begin
-  Result:= AValue xor rordword(AValue,16);
-  Result:= Result and $FF00FFFF;
-  Result:= (Result shr 8) xor rordword(AValue,8);
+  Temp  := AValue xor rordword(AValue,16);
+  Temp  := Temp and $FF00FFFF;
+  Result:= (Temp shr 8) xor rordword(AValue,8);
 end;
 
 function SwapEndian(const AValue: LongInt): LongInt;{$ifdef SYSTEMINLINE}inline;{$endif}