summaryrefslogtreecommitdiff
path: root/lib/VMCore/Value.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/VMCore/Value.cpp')
-rw-r--r--lib/VMCore/Value.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/VMCore/Value.cpp b/lib/VMCore/Value.cpp
index 38438265dd..29f6a8094f 100644
--- a/lib/VMCore/Value.cpp
+++ b/lib/VMCore/Value.cpp
@@ -363,6 +363,10 @@ bool Value::isDereferenceablePointer() const {
if (const GlobalVariable *GV = dyn_cast<GlobalVariable>(this))
return !GV->hasExternalWeakLinkage();
+ // byval arguments are ok.
+ if (const Argument *A = dyn_cast<Argument>(this))
+ return A->hasByValAttr();
+
// For GEPs, determine if the indexing lands within the allocated object.
if (const GEPOperator *GEP = dyn_cast<GEPOperator>(this)) {
// Conservatively require that the base pointer be fully dereferenceable.