aboutsummaryrefslogtreecommitdiff
path: root/llvm/unittests/Support/MathExtrasTest.cpp
diff options
context:
space:
mode:
authorJustin Lebar <jlebar@google.com>2016-07-17 18:19:23 +0000
committerJustin Lebar <jlebar@google.com>2016-07-17 18:19:23 +0000
commitab549c818751e5eef980173d5baa3c0ebaf449d8 (patch)
tree86aa935e136f15f048f3ae55612a1d332e87a300 /llvm/unittests/Support/MathExtrasTest.cpp
parentcbba3c4aefe92e5d2f6aa2b7fe8062e47fc28b57 (diff)
downloadllvm-ab549c818751e5eef980173d5baa3c0ebaf449d8.zip
llvm-ab549c818751e5eef980173d5baa3c0ebaf449d8.tar.gz
llvm-ab549c818751e5eef980173d5baa3c0ebaf449d8.tar.bz2
Add assertions checking SignExtend{32,64}'s bit width.
Summary: The bit width must be greater than zero, otherwise we shift by the integer's width, which is UB. Also (more obviously) the width must be less than or equal to the integer's width, otherwise we shift by a negative number, which is also UB. Reviewers: rnk Subscribers: llvm-commits, dylanmckay Differential Revision: https://reviews.llvm.org/D22442 llvm-svn: 275720
Diffstat (limited to 'llvm/unittests/Support/MathExtrasTest.cpp')
0 files changed, 0 insertions, 0 deletions