https://llvm.org/bugs/show_bug.cgi?id=25580
Bug ID: 25580 Summary: UBSan detects signed integer overflow for multiplication of uint16_t Product: new-bugs Version: trunk Hardware: All OS: All Status: NEW Severity: normal Priority: P Component: new bugs Assignee: unassignedb...@nondot.org Reporter: sli...@gmail.com CC: llvm-bugs@lists.llvm.org Classification: Unclassified Created attachment 15317 --> https://llvm.org/bugs/attachment.cgi?id=15317&action=edit simple test case demonstrating the failure First seen as a failing test for the SaturatingMultiply() function template added in r253497. Test case attached. $ clang++ -O1 -std=c++11 -fsanitize=undefined test.cpp -o test $ ./test main.cpp:25:11: runtime error: signed integer overflow: 65535 * 65535 cannot be represented in type 'int' Interestingly, the failure only occurs with uint16_t. The other unsigned types (uint8_t/uint32_t/uint64_t) pass if I comment out the uint16_t case. The issue reproduces at least with clang 3.6 on Ubuntu 15.10 x86_64 as well as trunk Mac OS X 10.11.1 / Xcode 7.1. -- 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