From: Chris Lattner Date: Fri, 28 Sep 2007 20:09:40 +0000 (+0000) Subject: Make Value::getNameLen not crash on an empty name, fixing PR1712. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=d7c4ca100932089aeee4a2596715b22fef95194f;p=oota-llvm.git Make Value::getNameLen not crash on an empty name, fixing PR1712. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42444 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/VMCore/Value.cpp b/lib/VMCore/Value.cpp index 4bacc2949d4..0150c7e6e96 100644 --- a/lib/VMCore/Value.cpp +++ b/lib/VMCore/Value.cpp @@ -128,7 +128,7 @@ const char *Value::getNameStart() const { /// 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; }