[ConstantInt] Check active bits before calling getZExtValue.
authorFlorian Hahn <flo@fhahn.com>
Wed, 12 Dec 2018 02:22:12 +0000 (02:22 +0000)
committerFlorian Hahn <flo@fhahn.com>
Wed, 12 Dec 2018 02:22:12 +0000 (02:22 +0000)
commitcc419ad7df2b90d07b7e36244cc24269be9435d8
tree8a525845a798610e20dbd9ee1f5399e86d36da1d
parent8272a71285609b9786bfc83611737069063b5414
[ConstantInt] Check active bits before calling getZExtValue.

Without this check, we hit an assertion in getZExtValue, if the constant
value does not fit into an uint64_t.

As getZExtValue returns an uint64_t, should we update
getAggregateElement to take an uin64_t as well?

This fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=6109.

Reviewers: efriedma, craig.topper, spatel

Reviewed By: efriedma

Differential Revision: https://reviews.llvm.org/D55547

llvm-svn: 348906
llvm/include/llvm/IR/Constant.h
llvm/lib/IR/Constants.cpp
llvm/test/Transforms/SCCP/apint-bigint2.ll