[compiler-rt] r243384 - [UBSan][MIPS] Fix cast-overflow tests for mips big endian
Sagar Thakur
sagar.thakur at imgtec.com
Mon Jul 27 22:51:51 PDT 2015
Author: slthakur
Date: Tue Jul 28 00:51:51 2015
New Revision: 243384
URL: http://llvm.org/viewvc/llvm-project?rev=243384&view=rev
Log:
[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
Modified:
compiler-rt/trunk/lib/ubsan/ubsan_value.cc
Modified: compiler-rt/trunk/lib/ubsan/ubsan_value.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/ubsan/ubsan_value.cc?rev=243384&r1=243383&r2=243384&view=diff
==============================================================================
--- compiler-rt/trunk/lib/ubsan/ubsan_value.cc (original)
+++ compiler-rt/trunk/lib/ubsan/ubsan_value.cc Tue Jul 28 00:51:51 2015
@@ -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);
More information about the llvm-commits
mailing list