summaryrefslogtreecommitdiff
path: root/Python/compile.c
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2016-06-12 09:22:01 +0300
committerSerhiy Storchaka <storchaka@gmail.com>2016-06-12 09:22:01 +0300
commit657ccfb66a6830b2f54743c60fd11bb210905f06 (patch)
treedbe93f7f56e67c976e826078e42b83b221bab2b7 /Python/compile.c
parenta9325421d37a70038bf0be6138ccac8a14cffec5 (diff)
downloadcpython-657ccfb66a6830b2f54743c60fd11bb210905f06.tar.gz
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 1e720eab0d..0c4a6c853f 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));
}
}