TargetLowering: Fix off-by-one error
authorMatthias Braun <matze@braunis.de>
Tue, 19 Dec 2017 00:05:10 +0000 (00:05 +0000)
committerMatthias Braun <matze@braunis.de>
Tue, 19 Dec 2017 00:05:10 +0000 (00:05 +0000)
This problem was present for a while, but somehow asan didn't catch
it before the refactoring in r321036.

llvm-svn: 321043

llvm/include/llvm/CodeGen/TargetLowering.h

index deeb57d..4cf589e 100644 (file)
@@ -2429,7 +2429,7 @@ private:
     PromoteToType;
 
   /// Stores the name each libcall.
-  const char *LibcallRoutineNames[RTLIB::UNKNOWN_LIBCALL];
+  const char *LibcallRoutineNames[RTLIB::UNKNOWN_LIBCALL + 1];
 
   /// The ISD::CondCode that should be used to test the result of each of the
   /// comparison libcall against zero.