aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-09-28 20:09:40 +0000
committerChris Lattner <sabre@nondot.org>2007-09-28 20:09:40 +0000
commitd7c4ca100932089aeee4a2596715b22fef95194f (patch)
tree471ba345eb0ea23fd084adb8c2bf18fe66af1f4e
parentddde335cb79d67c46c04b2a0ffd18750b6f70e28 (diff)
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
-rw-r--r--lib/VMCore/Value.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/VMCore/Value.cpp b/lib/VMCore/Value.cpp
index 4bacc2949d..0150c7e6e9 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;
}