From 135f9ce75cbacf4362cd9c659689c87b170a3d1d Mon Sep 17 00:00:00 2001 From: Jan Vorlicek Date: Thu, 5 Jan 2017 02:37:25 +0100 Subject: [PATCH] Fix unsigned_abs function on Unix (dotnet/coreclr#8805) The unsigned_abs function in jit.h is implemented using labs function. However labs has 32 bit argument / result, while the unsigned_abs expects it to be 64 bit. The correct function to use for FEATURE_PAL is llabs. But since we now have abs overload for __int64 in pal.h, we can just remove the #ifdef for FEATURE_PAL and use the same implementation for both Unix and Windows. Commit migrated from https://github.com/dotnet/coreclr/commit/d2daeccabf5c64c67a080928fc48a4d18d0464f9 --- src/coreclr/src/jit/jit.h | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/coreclr/src/jit/jit.h b/src/coreclr/src/jit/jit.h index 220294f..c485ff0 100644 --- a/src/coreclr/src/jit/jit.h +++ b/src/coreclr/src/jit/jit.h @@ -699,11 +699,7 @@ inline unsigned int unsigned_abs(int x) #ifdef _TARGET_64BIT_ inline size_t unsigned_abs(ssize_t x) { -#ifndef FEATURE_PAL return ((size_t)abs(x)); -#else // !FEATURE_PAL - return ((size_t)labs(x)); -#endif // !FEATURE_PAL } #endif // _TARGET_64BIT_ -- 2.7.4