Skip to content

Commit

Permalink
Merging r244646:
Browse files Browse the repository at this point in the history
------------------------------------------------------------------------
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.

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


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/branches/release_37@245111 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
dsandersllvm committed Aug 14, 2015
1 parent fa183e2 commit 25ac0b1
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/ubsan/ubsan_value.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 25ac0b1

Please sign in to comment.