[compiler-rt] r250806 - [ubsan] Fix looksLikeFloatCastOverflowDataV1 heuristic to work if one of the types is unknown.
Alexey Samsonov via llvm-commits
llvm-commits at lists.llvm.org
Tue Oct 20 12:00:58 PDT 2015
Thank you!
On Tue, Oct 20, 2015 at 1:40 AM, Yury Gribov via llvm-commits <
llvm-commits at lists.llvm.org> wrote:
> Author: ygribov
> Date: Tue Oct 20 03:40:52 2015
> New Revision: 250806
>
> URL: http://llvm.org/viewvc/llvm-project?rev=250806&view=rev
> Log:
> [ubsan] Fix looksLikeFloatCastOverflowDataV1 heuristic to work if one of
> the types is unknown.
>
> Differential revision: http://reviews.llvm.org/D13775
>
> Modified:
> compiler-rt/trunk/lib/ubsan/ubsan_handlers.cc
>
> Modified: compiler-rt/trunk/lib/ubsan/ubsan_handlers.cc
> URL:
> http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/ubsan/ubsan_handlers.cc?rev=250806&r1=250805&r2=250806&view=diff
>
> ==============================================================================
> --- compiler-rt/trunk/lib/ubsan/ubsan_handlers.cc (original)
> +++ compiler-rt/trunk/lib/ubsan/ubsan_handlers.cc Tue Oct 20 03:40:52 2015
> @@ -314,12 +314,14 @@ static bool looksLikeFloatCastOverflowDa
> sizeof(FilenameOrTypeDescriptor));
>
> // Heuristic: For float_cast_overflow, the TypeKind will be either
> TK_Integer
> - // (0x0) or TK_Float (0x1). Adding both bytes will be 0 or 1 (for BE or
> LE).
> - // If it were a filename, adding two printable characters will not
> yield such
> - // a value.
> + // (0x0), TK_Float (0x1) or TK_Unknown (0xff). If both types are known,
> + // adding both bytes will be 0 or 1 (for BE or LE). If it were a
> filename,
> + // adding two printable characters will not yield such a value.
> Otherwise,
> + // if one of them is 0xff, this is most likely TK_Unknown type
> descriptor.
> u16 MaybeFromTypeKind =
> FilenameOrTypeDescriptor[0] + FilenameOrTypeDescriptor[1];
> - return MaybeFromTypeKind < 2;
> + return MaybeFromTypeKind < 2 || FilenameOrTypeDescriptor[0] == 0xff ||
> + FilenameOrTypeDescriptor[1] == 0xff;
> }
>
> static void handleFloatCastOverflow(void *DataPtr, ValueHandle From,
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
--
Alexey Samsonov
vonosmas at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20151020/4a7cb9d8/attachment.html>
More information about the llvm-commits
mailing list