[llvm-commits] CVS: llvm/lib/VMCore/Function.cpp
John Criswell
criswell at cs.uiuc.edu
Tue Sep 9 11:59:02 PDT 2003
Changes in directory llvm/lib/VMCore:
Function.cpp updated: 1.48 -> 1.49
---
Log message:
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.
---
Diffs of the changes:
Index: llvm/lib/VMCore/Function.cpp
diff -u llvm/lib/VMCore/Function.cpp:1.48 llvm/lib/VMCore/Function.cpp:1.49
--- llvm/lib/VMCore/Function.cpp:1.48 Tue Sep 9 11:36:09 2003
+++ llvm/lib/VMCore/Function.cpp Tue Sep 9 11:58:41 2003
@@ -159,7 +159,7 @@
/// 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.'
More information about the llvm-commits
mailing list