@@ -1176,14 +1176,27 @@ bb0(%0 : $*Builtin.Int64, %1 : $Builtin.NativeObject):
1176
1176
return %6 : $(Builtin.Int64, Builtin.Int64)
1177
1177
}
1178
1178
1179
- sil @dont_crash_on_index_addr_projection : $@convention(thin) (Builtin.RawPointer) -> Int {
1179
+ sil @dont_crash_on_index_addr_projection : $@convention(thin) (Builtin.RawPointer) -> ( Int, Int, Int, Int) {
1180
1180
bb0(%0 : $Builtin.RawPointer):
1181
- %3 = integer_literal $Builtin.Word, 4294967295
1181
+ // Negative (valid constant index)
1182
+ %3 = integer_literal $Builtin.Word, 4294967295 // '0xffffffff'
1182
1183
%4 = pointer_to_address %0 : $Builtin.RawPointer to [strict] $*Int
1183
- // Just check if we can handle an index_addr projection with the special value of 0xffffffff
1184
1184
%5 = index_addr %4 : $*Int, %3 : $Builtin.Word
1185
1185
%6 = load %5 : $*Int
1186
- return %6 : $Int
1186
+ // TailIndex (invalid constant index)
1187
+ %7 = integer_literal $Builtin.Word, 2147483647 // '0x7fffffff'
1188
+ %8 = index_addr %4 : $*Int, %7 : $Builtin.Word
1189
+ %9 = load %8 : $*Int
1190
+ // UnknownOffset (valid index)
1191
+ %10 = integer_literal $Builtin.Word, 3221225472 // '0xC0000000'
1192
+ %11 = index_addr %4 : $*Int, %10 : $Builtin.Word
1193
+ %12 = load %11 : $*Int
1194
+ // Root (unused/invalid index))
1195
+ %13 = integer_literal $Builtin.Word, 2147483648 // '0x80000000'
1196
+ %14 = index_addr %4 : $*Int, %13 : $Builtin.Word
1197
+ %15 = load %14 : $*Int
1198
+ %99 = tuple (%6 : $Int, %9 : $Int, %12 : $Int, %15 : $Int)
1199
+ return %99 : $(Int, Int, Int, Int)
1187
1200
}
1188
1201
1189
1202
sil @overwrite_int : $@convention(thin) (@inout Int, Int) -> ()
0 commit comments