mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-02-14 17:28:53 +00:00
Fix isDereferenceablePointer not to try to take the size of an unsized type.
I'll add a test-case shortly. llvm-svn: 212687
This commit is contained in:
parent
54ccd892b9
commit
1e7ffc2c10
@ -492,7 +492,8 @@ static bool isDereferenceablePointer(const Value *V, const DataLayout *DL,
|
||||
if (const BitCastInst* BC = dyn_cast<BitCastInst>(V)) {
|
||||
Type *STy = BC->getSrcTy()->getPointerElementType(),
|
||||
*DTy = BC->getDestTy()->getPointerElementType();
|
||||
if ((DL->getTypeStoreSize(STy) >=
|
||||
if (STy->isSized() && DTy->isSized() &&
|
||||
(DL->getTypeStoreSize(STy) >=
|
||||
DL->getTypeStoreSize(DTy)) &&
|
||||
(DL->getABITypeAlignment(STy) >=
|
||||
DL->getABITypeAlignment(DTy)))
|
||||
|
Loading…
x
Reference in New Issue
Block a user