Reject "llvm." as a function name
authorChris Lattner <sabre@nondot.org>
Fri, 19 Sep 2003 19:31:41 +0000 (19:31 +0000)
committerChris Lattner <sabre@nondot.org>
Fri, 19 Sep 2003 19:31:41 +0000 (19:31 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8608 91177308-0d34-0410-b5e6-96231b3b80d8

lib/VMCore/Function.cpp

index 836c6b64a3353d4f8ffa8dc8fa67b736fba12c9f..a859a2b04a259ba45c0d7bf3b8750b7851bcda70 100644 (file)
@@ -158,9 +158,11 @@ void Function::dropAllReferences() {
 /// llvm/Intrinsics.h.
 ///
 unsigned Function::getIntrinsicID() const {
-  if (getName().size() <= 5 || 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.'
+
+  assert(getName().size() != 5 && "'llvm.' is an invalid intrinsic name!");
   
   // a table of all Alpha intrinsic functions
   struct {