bpo-41531: Fix compilation of dict literals with more than 0xFFFF elements (GH-21850) (GH-22107)
(cherry picked from commit c51db0ea40ddabaf5f771ea633b37fcf4c90a495)
Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
diff --git a/Python/compile.c b/Python/compile.c
index 7ec92e0..51af28b 100644
--- a/Python/compile.c
+++ b/Python/compile.c
@@ -3890,7 +3890,7 @@
}
else {
if (elements == 0xFFFF) {
- if (!compiler_subdict(c, e, i - elements, i)) {
+ if (!compiler_subdict(c, e, i - elements, i + 1)) {
return 0;
}
if (have_dict) {