diff options
author | John Criswell <criswell@uiuc.edu> | 2003-09-09 16:58:41 +0000 |
---|---|---|
committer | John Criswell <criswell@uiuc.edu> | 2003-09-09 16:58:41 +0000 |
commit | 531922aaca4216c2c672ece7a8cba593fdc9bd6d (patch) | |
tree | 0865b757031b9e3e213fa622fb72514365364bbe /lib/VMCore | |
parent | 21ca6ee7cdad69168d0470fcaedc6bb494b36776 (diff) | |
download | external_llvm-531922aaca4216c2c672ece7a8cba593fdc9bd6d.zip external_llvm-531922aaca4216c2c672ece7a8cba593fdc9bd6d.tar.gz external_llvm-531922aaca4216c2c672ece7a8cba593fdc9bd6d.tar.bz2 |
Reverting back to the previous revision.
We want to check for length 5 because we might get the "llvm." string as the
name. That string is in the LLVM namespace and should be checked as such.
We also don't have to worry about garbage data because (I believe) the string
class will return a valid value. So, the switch statement will work and we
don't have to worry about the code wandering into segfault land.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8419 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore')
-rw-r--r-- | lib/VMCore/Function.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/VMCore/Function.cpp b/lib/VMCore/Function.cpp index 5ef4ce4..74098ff 100644 --- a/lib/VMCore/Function.cpp +++ b/lib/VMCore/Function.cpp @@ -159,7 +159,7 @@ void Function::dropAllReferences() { /// llvm/Intrinsics.h. /// unsigned Function::getIntrinsicID() const { - if (getName().size() <= 6 || getName()[4] != '.' || getName()[0] != 'l' || + if (getName().size() <= 5 || getName()[4] != '.' || getName()[0] != 'l' || getName()[1] != 'l' || getName()[2] != 'v' || getName()[3] != 'm') return 0; // All intrinsics start with 'llvm.' |