summaryrefslogtreecommitdiffstats
path: root/Python/compile.c
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2022-07-20 10:42:05 (GMT)
committerGitHub <noreply@github.com>2022-07-20 10:42:05 (GMT)
commit16cb8ca52e404ceadbbbad4c5af498e76feefa1c (patch)
tree99b43e744ab27d53e3f8d478732743588b6f9864 /Python/compile.c
parent1093804b8855f95a27aabb4ed853f8138b82b261 (diff)
downloadcpython-16cb8ca52e404ceadbbbad4c5af498e76feefa1c.zip
cpython-16cb8ca52e404ceadbbbad4c5af498e76feefa1c.tar.gz
cpython-16cb8ca52e404ceadbbbad4c5af498e76feefa1c.tar.bz2
GH-94851: fix immortal objects refcounting in compiler (gh-95040)
(cherry picked from commit 74761548862eb5a324c23d86a6233d884f386f2e) Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
Diffstat (limited to 'Python/compile.c')
-rw-r--r--Python/compile.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Python/compile.c b/Python/compile.c
index 42f3730..3fe0930 100644
--- a/Python/compile.c
+++ b/Python/compile.c
@@ -4912,7 +4912,7 @@ compiler_joined_str(struct compiler *c, expr_ty e)
Py_ssize_t value_count = asdl_seq_LEN(e->v.JoinedStr.values);
if (value_count > STACK_USE_GUIDELINE) {
_Py_DECLARE_STR(empty, "");
- ADDOP_LOAD_CONST_NEW(c, &_Py_STR(empty));
+ ADDOP_LOAD_CONST_NEW(c, Py_NewRef(&_Py_STR(empty)));
ADDOP_NAME(c, LOAD_METHOD, &_Py_ID(join), names);
ADDOP_I(c, BUILD_LIST, 0);
for (Py_ssize_t i = 0; i < asdl_seq_LEN(e->v.JoinedStr.values); i++) {