Author: lattner
Date: Fri Sep 28 15:09:40 2007
New Revision: 42444

URL: http://llvm.org/viewvc/llvm-project?rev=42444&view=rev
Log:
Make Value::getNameLen not crash on an empty name, fixing PR1712.

Modified:
    llvm/trunk/lib/VMCore/Value.cpp

Modified: llvm/trunk/lib/VMCore/Value.cpp
URL: 
http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Value.cpp?rev=42444&r1=42443&r2=42444&view=diff

==============================================================================
--- llvm/trunk/lib/VMCore/Value.cpp (original)
+++ llvm/trunk/lib/VMCore/Value.cpp Fri Sep 28 15:09:40 2007
@@ -128,7 +128,7 @@
 /// getNameLen - Return the length of the string, correctly handling nul
 /// characters embedded into them.
 unsigned Value::getNameLen() const {
-  return Name->getKeyLength();
+  return Name ? Name->getKeyLength() : 0;
 }
 
 


_______________________________________________
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

Reply via email to