Skip to content

Commit 16cb8ca

Browse files
GH-94851: fix immortal objects refcounting in compiler (gh-95040)
(cherry picked from commit 7476154) Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
1 parent 1093804 commit 16cb8ca

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Python/compile.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -4912,7 +4912,7 @@ compiler_joined_str(struct compiler *c, expr_ty e)
49124912
Py_ssize_t value_count = asdl_seq_LEN(e->v.JoinedStr.values);
49134913
if (value_count > STACK_USE_GUIDELINE) {
49144914
_Py_DECLARE_STR(empty, "");
4915-
ADDOP_LOAD_CONST_NEW(c, &_Py_STR(empty));
4915+
ADDOP_LOAD_CONST_NEW(c, Py_NewRef(&_Py_STR(empty)));
49164916
ADDOP_NAME(c, LOAD_METHOD, &_Py_ID(join), names);
49174917
ADDOP_I(c, BUILD_LIST, 0);
49184918
for (Py_ssize_t i = 0; i < asdl_seq_LEN(e->v.JoinedStr.values); i++) {

0 commit comments

Comments
 (0)