summaryrefslogtreecommitdiffstats
path: root/llvm/lib/VMCore/Value.cpp
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
commit2be9ec5c915c1f22a6b3b3e2ccabc814cfec20d6 (patch)
treed096d381bebf91f2c041efbff774cf5496b6c3db /llvm/lib/VMCore/Value.cpp
parentf72693f36e80c65dc7b45c8f0e54a1a44c687025 (diff)
downloadbcm5719-llvm-2be9ec5c915c1f22a6b3b3e2ccabc814cfec20d6.tar.gz
bcm5719-llvm-2be9ec5c915c1f22a6b3b3e2ccabc814cfec20d6.zip
Make Value::getNameLen not crash on an empty name, fixing PR1712.
llvm-svn: 42444
Diffstat (limited to 'llvm/lib/VMCore/Value.cpp')
-rw-r--r--llvm/lib/VMCore/Value.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/VMCore/Value.cpp b/llvm/lib/VMCore/Value.cpp
index 4bacc2949d4..0150c7e6e96 100644
--- a/llvm/lib/VMCore/Value.cpp
+++ b/llvm/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;
}
OpenPOWER on IntegriCloud