[UBSan][MIPS] Fix cast-overflow tests for mips big endian

This fixes the bug https://llvm.org/bugs/show_bug.cgi?id=24152
The float value resides in the first 4 bytes of ValueHandle for both mips and mipsel.

Reviewers: dsanders, samsonov
Subscibers: rsmith, hans, mohit.bhakkad, jaydeep, llvm-commits
Differential: http://reviews.llvm.org/D11448
llvm-svn: 243384
This commit is contained in:
Sagar Thakur 2015-07-28 05:51:51 +00:00
parent b56c50f0ec
commit 13af03286e
1 changed files with 1 additions and 1 deletions

View File

@ -83,7 +83,7 @@ FloatMax Value::getFloatValue() const {
#endif
case 32: {
float Value;
#if defined(__BIG_ENDIAN__)
#if defined(__BIG_ENDIAN__) && !defined(__mips__)
// For big endian the float value is in the second 4 bytes
// instead of the first 4 bytes.
internal_memcpy(&Value, ((const char*)&Val)+4, 4);