Skip to content

Commit 636164e

Browse files
committed
Fix get item keep alives
1 parent 02fcac7 commit 636164e

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

mypyc/irbuild/vec.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,6 @@ def vec_get_item(
288288
index = vec_check_and_adjust_index(builder, len_val, index, line)
289289
return vec_get_item_unsafe(builder, base, index, line, can_borrow=can_borrow)
290290

291-
292291
def vec_get_item_unsafe(
293292
builder: LowLevelIRBuilder, base: Value, index: Value, line: int, *, can_borrow: bool = False
294293
) -> Value:
@@ -298,7 +297,7 @@ def vec_get_item_unsafe(
298297
vtype = base.type
299298
item_addr = vec_item_ptr(builder, base, index)
300299
result = builder.load_mem(item_addr, vtype.item_type, borrow=can_borrow)
301-
builder.keep_alive([base], line)
300+
builder.keep_alives.append(base)
302301
return result
303302

304303

0 commit comments

Comments
 (0)