Re: r293343 - [ubsan] Sanity-check shift amounts before truncation (fixes PR27271)

2017-01-30 Thread Filipe Cabecinhas via cfe-commits
Another example + possible fix (two WidthMinusOne, one per (possibly different) bitwidth): (not fully tested) int f() { return 0 << 0L; } diff --git a/lib/CodeGen/CGExprScalar.cpp b/lib/CodeGen/CGExprScalar.cpp index 40d949dece..5c9055d49a 100644 --- a/lib/CodeGen/CGExprScalar.cpp +++ b/lib/Cod

Re: r293343 - [ubsan] Sanity-check shift amounts before truncation (fixes PR27271)

2017-01-30 Thread Alex L via cfe-commits
Hi Vedant, This commit has caused a compiler crash in our stage 2 green dragon ASAN+Ubsan bot ( http://lab.llvm.org:8080/green/job/clang-stage2-cmake-RgSan_build/). I have reverted it in r293475. The following example reproduces the crash with -fsanitize=undefined : typedef unsigned long long u