This is an archive of the discontinued LLVM Phabricator instance.

Support unknown types in looksLikeFloatCastOverflowDataV1 heuristic.
ClosedPublic

Authored by m.ostapenko on Oct 15 2015, 8:35 AM.

Details

Summary

Hi,

trying to merge recent sanitizer library into GCC, I've run to the issue: looksLikeFloatCastOverflowDataV1 heuristic failed to work if one of the types is unknown (GCC's _Decimal32 was my case, AFAIK UBSan doesn't support decimal floating types). I see, this is a GCC - specific issue, but since we just make heuristic more precise... . I wonder if it's possible to change heuristic in a such way to support both LLVM and GCC.

Another approach would be to add new entry function (say, __ubsan_handle_float_cast_overflow_old), but I'm not sure what approach is more desirable here.

Thanks.

Diff Detail

Repository
rL LLVM

Event Timeline

m.ostapenko retitled this revision from to Support unknown types in looksLikeFloatCastOverflowDataV1 heuristic..
m.ostapenko updated this object.
m.ostapenko added reviewers: filcab, samsonov.
m.ostapenko set the repository for this revision to rL LLVM.
m.ostapenko added subscribers: llvm-commits, ygribov.
filcab edited edge metadata.Oct 16 2015, 4:16 AM

LGTM. Creating another entry function was what we were avoiding. ;-)

lib/ubsan/ubsan_handlers.cc
320 ↗(On Diff #37483)

Minor nit: s/probably/most likely/

m.ostapenko edited edge metadata.

Thanks! Addressing Filipe's nit.

I'm sorry, this issue blocks my work on merging sanitizer library into GCC. Is it OK to commit? If not, could someone proceed the review please?

filcab accepted this revision.Oct 19 2015, 9:11 AM
filcab edited edge metadata.

Ah, sorry. I thought you had already comitted, but with the nit fixed.
Go ahead and commit. Thank you!

This revision is now accepted and ready to land.Oct 19 2015, 9:11 AM
This revision was automatically updated to reflect the committed changes.