From 78429a6aa6bb4f8527f0c6be678555ef26b62d19 Mon Sep 17 00:00:00 2001 From: Gustavo Niemeyer Date: Mon, 16 Dec 2002 13:54:02 +0000 Subject: Fixing bug [#448679] Left to right * Python/compile.c (com_dictmaker): Reordered evaluation of dictionaries to follow strict LTR evaluation. * Lib/compiler/pycodegen.py (CodeGenerator.visitDict): Reordered evaluation of dictionaries to follow strict LTR evaluation. * Doc/ref/ref5.tex Documented the general LTR evaluation order idea. * Misc/NEWS Documented change in evaluation order of dictionaries. --- Python/compile.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Python/compile.c') diff --git a/Python/compile.c b/Python/compile.c index b438ce44f9..17555219d4 100644 --- a/Python/compile.c +++ b/Python/compile.c @@ -1529,9 +1529,9 @@ com_dictmaker(struct compiling *c, node *n) It wants the stack to look like (value) (dict) (key) */ com_addbyte(c, DUP_TOP); com_push(c, 1); - com_node(c, CHILD(n, i+2)); /* value */ - com_addbyte(c, ROT_TWO); com_node(c, CHILD(n, i)); /* key */ + com_node(c, CHILD(n, i+2)); /* value */ + com_addbyte(c, ROT_THREE); com_addbyte(c, STORE_SUBSCR); com_pop(c, 3); } -- cgit v1.2.1