[llvm-branch-commits] [compiler-rt-branch] r245111 - Merging r244646:

Daniel Sanders via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Fri Aug 14 15:34:26 PDT 2015


Author: dsanders
Date: Fri Aug 14 17:34:26 2015
New Revision: 245111

URL: http://llvm.org/viewvc/llvm-project?rev=245111&view=rev
Log:
Merging r244646:
------------------------------------------------------------------------
r244646 | dsanders | 2015-08-11 19:40:02 +0100 (Tue, 11 Aug 2015) | 5 lines

[ubsan][mips] Revise r243384 to avoid special casing big-endian mips.

Account for the case when uptr is 32-bit instead of trying to fix this case
using the little endian path.

------------------------------------------------------------------------

Modified:
    compiler-rt/branches/release_37/   (props changed)
    compiler-rt/branches/release_37/lib/ubsan/ubsan_value.cc

Propchange: compiler-rt/branches/release_37/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Aug 14 17:34:26 2015
@@ -1 +1 @@
-/compiler-rt/trunk:242350,242424,242444,242449,242539-242540,242647,242651,243170,243384,243604,243615,243686,244002
+/compiler-rt/trunk:242350,242424,242444,242449,242539-242540,242647,242651,243170,243384,243604,243615,243686,244002,244646

Modified: compiler-rt/branches/release_37/lib/ubsan/ubsan_value.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/branches/release_37/lib/ubsan/ubsan_value.cc?rev=245111&r1=245110&r2=245111&view=diff
==============================================================================
--- compiler-rt/branches/release_37/lib/ubsan/ubsan_value.cc (original)
+++ compiler-rt/branches/release_37/lib/ubsan/ubsan_value.cc Fri Aug 14 17:34:26 2015
@@ -83,11 +83,11 @@ FloatMax Value::getFloatValue() const {
 #endif
       case 32: {
         float Value;
-#if defined(__BIG_ENDIAN__) && !defined(__mips__)
-       // For big endian the float value is in the highest addressed 4 bytes
-       // (the least significant bits) but we must also consider that we might
-       // have a 32-bit type.
-       internal_memcpy(&Value, ((const char*)&Val + 1) - 4, 4);
+#if defined(__BIG_ENDIAN__)
+       // For big endian the float value is in the last 4 bytes.
+       // On some targets we may only have 4 bytes so we count backwards from
+       // the end of Val to account for both the 32-bit and 64-bit cases.
+       internal_memcpy(&Value, ((const char*)(&Val + 1)) - 4, 4);
 #else 
        internal_memcpy(&Value, &Val, 4);
 #endif




More information about the llvm-branch-commits mailing list