[llvm] [Docs] Fix GEP type in example (PR #68533)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Sun Oct 8 13:19:52 PDT 2023


================
@@ -200,7 +200,7 @@ fine:
 
   @MyVar = external global { i32, [40 x i32 ] }
   ...
-  %idx = getelementptr { [40 x i32] }, ptr @MyVal, i64 0, i32 1, i64 17
+  %idx = getelementptr { i32, [40 x i32] }, ptr @MyVal, i64 0, i32 1, i32 0, i64 17
----------------
nikic wrote:

I don't think the extra `i32 0` index should be there? `i32 1` selects the `[40 x i32]` and `i64 17` indexes into the array.

https://github.com/llvm/llvm-project/pull/68533


More information about the llvm-commits mailing list