[llvm-commits] [llvm] r42444 - /llvm/trunk/lib/VMCore/Value.cpp
    Chris Lattner 
    sabre at nondot.org
       
    Fri Sep 28 13:09:40 PDT 2007
    
    
  
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;
 }
 
 
    
    
More information about the llvm-commits
mailing list