From 14442c9a4d84eb6ac5bf81eaad5e852a07d3d78d Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Fri, 28 Sep 2007 20:09:40 +0000 Subject: [PATCH] Make Value::getNameLen not crash on an empty name, fixing PR1712. llvm-svn: 42444 --- lib/VMCore/Value.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; }