[PATCH] D11448: [UBSan][MIPS] Fix cast-overflow tests for mips big endian.

Sagar Thakur Sagar.Thakur at imgtec.com
Wed Jul 22 20:58:08 PDT 2015


sagar created this revision.
sagar added reviewers: samsonov, dsanders.
sagar added subscribers: jaydeep, mohit.bhakkad, llvm-commits.
sagar set the repository for this revision to rL LLVM.

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

Repository:
  rL LLVM

http://reviews.llvm.org/D11448

Files:
  lib/ubsan/ubsan_value.cc

Index: lib/ubsan/ubsan_value.cc
===================================================================
--- lib/ubsan/ubsan_value.cc
+++ lib/ubsan/ubsan_value.cc
@@ -83,7 +83,7 @@
 #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);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D11448.30445.patch
Type: text/x-patch
Size: 472 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150723/3dc30cfb/attachment.bin>


More information about the llvm-commits mailing list