Fix thinko
authorChris Lattner <sabre@nondot.org>
Fri, 30 Jan 2004 22:48:02 +0000 (22:48 +0000)
committerChris Lattner <sabre@nondot.org>
Fri, 30 Jan 2004 22:48:02 +0000 (22:48 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11027 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/BasicAliasAnalysis.cpp

index dd66eb59b036281718955c708ca89fd8d60f8245..4b46f7d9000b01f4ba048bfe58ddb0edee55ac23 100644 (file)
@@ -130,9 +130,9 @@ static const Value *GetGEPOperands(const Value *V, std::vector<Value*> &GEPOps){
 /// pointsToConstantMemory - Chase pointers until we find a (constant
 /// global) or not.
 bool BasicAliasAnalysis::pointsToConstantMemory(const Value *P) {
-  const Value *V = getUnderlyingObject(P);
-  if (const GlobalVariable *GV = dyn_cast<GlobalVariable>(V))
-    return GV->isConstant();
+  if (const Value *V = getUnderlyingObject(P))
+    if (const GlobalVariable *GV = dyn_cast<GlobalVariable>(V))
+      return GV->isConstant();
   return false;
 }