Make this actually work.
authorAlkis Evlogimenos <alkis@evlogimenos.com>
Sun, 24 Oct 2004 03:02:16 +0000 (03:02 +0000)
committerAlkis Evlogimenos <alkis@evlogimenos.com>
Sun, 24 Oct 2004 03:02:16 +0000 (03:02 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17199 91177308-0d34-0410-b5e6-96231b3b80d8

lib/VMCore/Constants.cpp

index 3d2e658e634f3f9be7bc92d7c4ee4b9b1a034b89..bf6332b44c7c4a0ee0ba488be693fcd888655938 100644 (file)
@@ -1245,10 +1245,10 @@ Constant *ConstantExpr::getZeroExtend(Constant *C, const Type *Ty) {
 }
 
 Constant *ConstantExpr::getSizeOf(const Type *Ty) {
-  // sizeof is implemented as: (unsigned) gep (Ty)null, 1
+  // sizeof is implemented as: (unsigned) gep (Ty*)null, 1
   return getCast(
     getGetElementPtr(
-      getNullValue(Ty),
+      getNullValue(PointerType::get(Ty)),
       std::vector<Constant*>(1, ConstantInt::get(Type::UByteTy, 1))),
     Type::UIntTy);
 }