https://bugs.llvm.org/show_bug.cgi?id=33442
Bug ID: 33442
Summary: UBSAN: right shift by negative value is not caught for
some values
Product: clang
Version: trunk
Hardware: PC
OS: All
Status: NEW
Severity: enhancement
Priority: P
Component: Frontend
Assignee: unassignedclangb...@nondot.org
Reporter: babo...@gmail.com
CC: llvm-bugs@lists.llvm.org
clang trunk
RHS of shift operator is negative, but UBSAN doesn't trigger. Effect is value
sensitive (change to x-1 to see that UBSAN triggers). Computation in the
example do not involve overflow/underflow.
> cat f.cpp
long long int x = -2869500996303312813LL;
int i;
int main() {
i = 0 >> (x - 280373316);
return 0;
}
> clang++ -std=c++11 -fsanitize=undefined f.cpp -o out
> ./out
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs