mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-14 11:32:34 +00:00
Fix isDereferenceablePointer not to try to take the size of an unsized type.
I'll add a test-case shortly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212687 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
a739834446
commit
5ee0267e49
@ -492,7 +492,8 @@ static bool isDereferenceablePointer(const Value *V, const DataLayout *DL,
|
|||||||
if (const BitCastInst* BC = dyn_cast<BitCastInst>(V)) {
|
if (const BitCastInst* BC = dyn_cast<BitCastInst>(V)) {
|
||||||
Type *STy = BC->getSrcTy()->getPointerElementType(),
|
Type *STy = BC->getSrcTy()->getPointerElementType(),
|
||||||
*DTy = BC->getDestTy()->getPointerElementType();
|
*DTy = BC->getDestTy()->getPointerElementType();
|
||||||
if ((DL->getTypeStoreSize(STy) >=
|
if (STy->isSized() && DTy->isSized() &&
|
||||||
|
(DL->getTypeStoreSize(STy) >=
|
||||||
DL->getTypeStoreSize(DTy)) &&
|
DL->getTypeStoreSize(DTy)) &&
|
||||||
(DL->getABITypeAlignment(STy) >=
|
(DL->getABITypeAlignment(STy) >=
|
||||||
DL->getABITypeAlignment(DTy)))
|
DL->getABITypeAlignment(DTy)))
|
||||||
|
Loading…
Reference in New Issue
Block a user