diff Python/ast.c @ 39037:9f70f6ba7b69 legacy-trunk

Fix AST compiler bug #1501934: incorrect LOAD/STORE_GLOBAL generation.
author Neil Schemenauer <nascheme@enme.ucalgary.ca>
date Sun, 09 Jul 2006 16:16:34 +0000
parents 066aa42ce5f2
children 64ccd745ea92
line wrap: on
line diff
--- a/Python/ast.c	Sat Jul 08 19:55:05 2006 +0000
+++ b/Python/ast.c	Sun Jul 09 16:16:34 2006 +0000
@@ -339,7 +339,7 @@
     /* The ast defines augmented store and load contexts, but the
        implementation here doesn't actually use them.  The code may be
        a little more complex than necessary as a result.  It also means
-       that expressions in an augmented assignment have no context.
+       that expressions in an augmented assignment have a Store context.
        Consider restructuring so that augmented assignment uses
        set_context(), too.
     */
@@ -1901,7 +1901,7 @@
 
         if (!expr1)
             return NULL;
-        /* TODO(jhylton): Figure out why set_context() can't be used here. */
+        /* TODO(nas): Remove duplicated error checks (set_context does it) */
         switch (expr1->kind) {
             case GeneratorExp_kind:
                 ast_error(ch, "augmented assignment to generator "
@@ -1923,6 +1923,7 @@
                           "assignment");
                 return NULL;
         }
+	set_context(expr1, Store, ch);
 
 	ch = CHILD(n, 2);
 	if (TYPE(ch) == testlist)