diff Python/compile.c @ 26670:1312297887a3 legacy-trunk

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.
author Gustavo Niemeyer <gustavo@niemeyer.net>
date Mon, 16 Dec 2002 13:54:02 +0000
parents cc05c2c8660e
children 45ab31127bf9
line wrap: on
line diff
--- a/Python/compile.c	Mon Dec 16 13:16:25 2002 +0000
+++ b/Python/compile.c	Mon Dec 16 13:54:02 2002 +0000
@@ -1529,9 +1529,9 @@
 		   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)); /* key */
 		com_node(c, CHILD(n, i+2)); /* value */
-		com_addbyte(c, ROT_TWO);
-		com_node(c, CHILD(n, i)); /* key */
+		com_addbyte(c, ROT_THREE);
 		com_addbyte(c, STORE_SUBSCR);
 		com_pop(c, 3);
 	}