Make 91378 more conservative.
[oota-llvm.git] / lib / Analysis / ConstantFolding.cpp
index 4b0b9a54c774bcc474c9b66386351f53e6266e6b..eaf90d014ffebf72b47f2a1ffb962984972bd6a8 100644 (file)
@@ -432,7 +432,7 @@ Constant *llvm::ConstantFoldLoadFromConstPtr(Constant *C,
   // Instead of loading constant c string, use corresponding integer value
   // directly if string length is small enough.
   std::string Str;
-  if (TD && GetConstantStringInfo(CE->getOperand(0), Str) && !Str.empty()) {
+  if (TD && GetConstantStringInfo(CE, Str) && !Str.empty()) {
     unsigned StrLen = Str.length();
     const Type *Ty = cast<PointerType>(CE->getType())->getElementType();
     unsigned NumBits = Ty->getPrimitiveSizeInBits();