projects
/
oota-llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
224251d
)
Add a comment about the "getelementptr null" trick.
author
Dan Gohman
<gohman@apple.com>
Mon, 27 Jul 2009 21:59:50 +0000
(21:59 +0000)
committer
Dan Gohman
<gohman@apple.com>
Mon, 27 Jul 2009 21:59:50 +0000
(21:59 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77262
91177308
-0d34-0410-b5e6-
96231b3b80d8
lib/VMCore/LLVMContext.cpp
patch
|
blob
|
history
diff --git
a/lib/VMCore/LLVMContext.cpp
b/lib/VMCore/LLVMContext.cpp
index d7f4594e3ab4e860137c20022be6ed2a692c7b37..722e29ee5dca0fce83805451207e4206ab531ad2 100644
(file)
--- a/
lib/VMCore/LLVMContext.cpp
+++ b/
lib/VMCore/LLVMContext.cpp
@@
-419,6
+419,7
@@
Constant* LLVMContext::getConstantExprInsertValue(Constant* Agg, Constant* Val,
Constant* LLVMContext::getConstantExprSizeOf(const Type* Ty) {
// sizeof is implemented as: (i64) gep (Ty*)null, 1
+ // Note that a non-inbounds gep is used, as null isn't within any object.
Constant *GEPIdx = ConstantInt::get(Type::Int32Ty, 1);
Constant *GEP = getConstantExprGetElementPtr(
getNullValue(getPointerTypeUnqual(Ty)), &GEPIdx, 1);