summaryrefslogtreecommitdiffstats
path: root/Python/compile.c
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2016-06-12 06:22:01 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2016-06-12 06:22:01 (GMT)
commit3c317e76a2fe78896b546e08fa753075463e7d41 (patch)
tree276a4ad8a5bb81afec80673cec93a76ab3f33974 /Python/compile.c
parent4f8aaf644095fef61ba1104af0f07efe2a099079 (diff)
downloadcpython-3c317e76a2fe78896b546e08fa753075463e7d41.zip
cpython-3c317e76a2fe78896b546e08fa753075463e7d41.tar.gz
cpython-3c317e76a2fe78896b546e08fa753075463e7d41.tar.bz2
Issue #27286: Fixed compiling BUILD_MAP_UNPACK_WITH_CALL opcode. Calling
function with generalized unpacking (PEP 448) and conflicting keyword names could cause undefined behavior.
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 1e720ea..0c4a6c8 100644
--- a/Python/compile.c
+++ b/Python/compile.c
@@ -3262,7 +3262,7 @@ compiler_call_helper(struct compiler *c,
code |= 2;
if (nsubkwargs > 1) {
/* Pack it all up */
- int function_pos = n + (code & 1) + nkw + 1;
+ int function_pos = n + (code & 1) + 2 * nkw + 1;
ADDOP_I(c, BUILD_MAP_UNPACK_WITH_CALL, nsubkwargs | (function_pos << 8));
}
}