mirror of
https://github.com/RPCSX/llvm.git
synced 2024-12-02 00:36:36 +00:00
Fix a bug that was found by building clang with -fsanitize.
I introduced it in r166785. PR14291. If TD is unavailable use getScalarSizeInBits, but don't optimize pointers or vectors of pointers. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170586 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
83ccac71ff
commit
521396ab37
@ -433,7 +433,12 @@ void llvm::ComputeMaskedBits(Value *V, APInt &KnownZero, APInt &KnownOne,
|
||||
unsigned SrcBitWidth;
|
||||
// Note that we handle pointer operands here because of inttoptr/ptrtoint
|
||||
// which fall through here.
|
||||
SrcBitWidth = TD->getTypeSizeInBits(SrcTy->getScalarType());
|
||||
if(TD) {
|
||||
SrcBitWidth = TD->getTypeSizeInBits(SrcTy->getScalarType());
|
||||
} else {
|
||||
SrcBitWidth = SrcTy->getScalarSizeInBits();
|
||||
if (!SrcBitWidth) return;
|
||||
}
|
||||
|
||||
assert(SrcBitWidth && "SrcBitWidth can't be zero");
|
||||
KnownZero = KnownZero.zextOrTrunc(SrcBitWidth);
|
||||
|
Loading…
Reference in New Issue
Block a user