[PATCH] D29234: [ubsan] Sanity-check shift amounts before truncation (fixes PR27271)

2017-01-27 Thread Phabricator via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL293343: [ubsan] Sanity-check shift amounts before truncation (fixes PR27271) (authored by vedantk). Changed prior to commit: https://reviews.llvm.org/D29234?vs=86130=86134#toc Repository: rL LLVM

[PATCH] D29234: [ubsan] Sanity-check shift amounts before truncation (fixes PR27271)

2017-01-27 Thread Vedant Kumar via Phabricator via cfe-commits
vsk created this revision. Ubsan does not report UB shifts in some cases where the shift exponent needs to be truncated to match the type of the shift base. We perform a range check on the truncated shift amount, leading to false negatives. Fix the issue (PR27271) by performing the range check