]> granicus.if.org Git - python/commitdiff
XXX_NAME ops should affect varnames
authorJeremy Hylton <jeremy@alum.mit.edu>
Tue, 28 Aug 2001 16:36:12 +0000 (16:36 +0000)
committerJeremy Hylton <jeremy@alum.mit.edu>
Tue, 28 Aug 2001 16:36:12 +0000 (16:36 +0000)
varnames should list all the local variables (with arguments first).
The XXX_NAME ops typically occur at the module level and assignment
ops should create locals.

Lib/compiler/pyassem.py
Tools/compiler/compiler/pyassem.py

index 06846233be4d0254deb67e31f223a191281c294e..3063b5b253b5b636933150125d4890f5937ab1d3 100644 (file)
@@ -491,9 +491,12 @@ class PyFlowGraph(FlowGraph):
     _convert_STORE_FAST = _convert_LOAD_FAST
     _convert_DELETE_FAST = _convert_LOAD_FAST
 
+    def _convert_LOAD_NAME(self, arg):
+        return self._lookupName(arg, self.names)
+
     def _convert_NAME(self, arg):
+        self._lookupName(arg, self.varnames)
         return self._lookupName(arg, self.names)
-    _convert_LOAD_NAME = _convert_NAME
     _convert_STORE_NAME = _convert_NAME
     _convert_DELETE_NAME = _convert_NAME
     _convert_IMPORT_NAME = _convert_NAME
index 06846233be4d0254deb67e31f223a191281c294e..3063b5b253b5b636933150125d4890f5937ab1d3 100644 (file)
@@ -491,9 +491,12 @@ class PyFlowGraph(FlowGraph):
     _convert_STORE_FAST = _convert_LOAD_FAST
     _convert_DELETE_FAST = _convert_LOAD_FAST
 
+    def _convert_LOAD_NAME(self, arg):
+        return self._lookupName(arg, self.names)
+
     def _convert_NAME(self, arg):
+        self._lookupName(arg, self.varnames)
         return self._lookupName(arg, self.names)
-    _convert_LOAD_NAME = _convert_NAME
     _convert_STORE_NAME = _convert_NAME
     _convert_DELETE_NAME = _convert_NAME
     _convert_IMPORT_NAME = _convert_NAME