1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 19:52:54 +01:00

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.

llvm-svn: 8419
This commit is contained in:
John Criswell 2003-09-09 16:58:41 +00:00
parent 0641f1fad7
commit 6b94d6a603

View File

@ -159,7 +159,7 @@ void Function::dropAllReferences() {
/// llvm/Intrinsics.h. /// llvm/Intrinsics.h.
/// ///
unsigned Function::getIntrinsicID() const { 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') getName()[1] != 'l' || getName()[2] != 'v' || getName()[3] != 'm')
return 0; // All intrinsics start with 'llvm.' return 0; // All intrinsics start with 'llvm.'