Skip to content

Commit 7476154

Browse files
GH-94851: fix immortal objects refcounting in compiler (gh-95040)
1 parent bd390ef commit 7476154

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Python/compile.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4857,7 +4857,7 @@ compiler_joined_str(struct compiler *c, expr_ty e)
48574857
Py_ssize_t value_count = asdl_seq_LEN(e->v.JoinedStr.values);
48584858
if (value_count > STACK_USE_GUIDELINE) {
48594859
_Py_DECLARE_STR(empty, "");
4860-
ADDOP_LOAD_CONST_NEW(c, &_Py_STR(empty));
4860+
ADDOP_LOAD_CONST_NEW(c, Py_NewRef(&_Py_STR(empty)));
48614861
ADDOP_NAME(c, LOAD_METHOD, &_Py_ID(join), names);
48624862
ADDOP_I(c, BUILD_LIST, 0);
48634863
for (Py_ssize_t i = 0; i < asdl_seq_LEN(e->v.JoinedStr.values); i++) {

0 commit comments

Comments
 (0)