[libc-commits] [libc] 2e9f15e - [libc] Fix index into argument vector

Joseph Huber via libc-commits libc-commits at lists.llvm.org
Tue Aug 6 12:07:11 PDT 2024


Author: Joseph Huber
Date: 2024-08-06T14:06:51-05:00
New Revision: 2e9f15e1dfd8bc90d0cd91157c8b3b036cee981e

URL: https://github.com/llvm/llvm-project/commit/2e9f15e1dfd8bc90d0cd91157c8b3b036cee981e
DIFF: https://github.com/llvm/llvm-project/commit/2e9f15e1dfd8bc90d0cd91157c8b3b036cee981e.diff

LOG: [libc] Fix index into argument vector

Added: 
    

Modified: 
    libc/utils/gpu/loader/Loader.h

Removed: 
    


################################################################################
diff  --git a/libc/utils/gpu/loader/Loader.h b/libc/utils/gpu/loader/Loader.h
index fd558a33b960a..8722f59175825 100644
--- a/libc/utils/gpu/loader/Loader.h
+++ b/libc/utils/gpu/loader/Loader.h
@@ -85,7 +85,7 @@ void *copy_argument_vector(int argc, const char **argv, Allocator alloc) {
   }
 
   // Ensure the vector is null terminated.
-  reinterpret_cast<void **>(dev_argv)[argc + 1] = nullptr;
+  reinterpret_cast<void **>(dev_argv)[argc] = nullptr;
   return dev_argv;
 }
 


        


More information about the libc-commits mailing list