projects
/
platform
/
upstream
/
llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2e42c34
)
Fix isDereferenceablePointer not to try to take the size of an unsized type.
author
Hal Finkel
<hfinkel@anl.gov>
Thu, 10 Jul 2014 06:06:11 +0000
(06:06 +0000)
committer
Hal Finkel
<hfinkel@anl.gov>
Thu, 10 Jul 2014 06:06:11 +0000
(06:06 +0000)
I'll add a test-case shortly.
llvm-svn: 212687
llvm/lib/IR/Value.cpp
patch
|
blob
|
history
diff --git
a/llvm/lib/IR/Value.cpp
b/llvm/lib/IR/Value.cpp
index
d61b8e5
..
35c241a
100644
(file)
--- a/
llvm/lib/IR/Value.cpp
+++ b/
llvm/lib/IR/Value.cpp
@@
-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)))