mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
bpo-46161: Fix bug in starunpack_helper in compile.c (GH-30235)
This commit is contained in:
parent
62a6594e66
commit
c118c2455c
3 changed files with 23 additions and 1 deletions
|
@ -4233,7 +4233,7 @@ starunpack_helper(struct compiler *c, asdl_expr_seq *elts, int pushed,
|
|||
Py_INCREF(val);
|
||||
PyTuple_SET_ITEM(folded, i, val);
|
||||
}
|
||||
if (tuple) {
|
||||
if (tuple && !pushed) {
|
||||
ADDOP_LOAD_CONST_NEW(c, folded);
|
||||
} else {
|
||||
if (add == SET_ADD) {
|
||||
|
@ -4245,6 +4245,9 @@ starunpack_helper(struct compiler *c, asdl_expr_seq *elts, int pushed,
|
|||
ADDOP_I(c, build, pushed);
|
||||
ADDOP_LOAD_CONST_NEW(c, folded);
|
||||
ADDOP_I(c, extend, 1);
|
||||
if (tuple) {
|
||||
ADDOP(c, LIST_TO_TUPLE);
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue