Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 63db7b9

Browse files
committed
XXX_NAME ops should affect varnames
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.
1 parent f354575 commit 63db7b9

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

Lib/compiler/pyassem.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -491,9 +491,12 @@ def _convert_LOAD_FAST(self, arg):
491491
_convert_STORE_FAST = _convert_LOAD_FAST
492492
_convert_DELETE_FAST = _convert_LOAD_FAST
493493

494+
def _convert_LOAD_NAME(self, arg):
495+
return self._lookupName(arg, self.names)
496+
494497
def _convert_NAME(self, arg):
498+
self._lookupName(arg, self.varnames)
495499
return self._lookupName(arg, self.names)
496-
_convert_LOAD_NAME = _convert_NAME
497500
_convert_STORE_NAME = _convert_NAME
498501
_convert_DELETE_NAME = _convert_NAME
499502
_convert_IMPORT_NAME = _convert_NAME

Tools/compiler/compiler/pyassem.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -491,9 +491,12 @@ def _convert_LOAD_FAST(self, arg):
491491
_convert_STORE_FAST = _convert_LOAD_FAST
492492
_convert_DELETE_FAST = _convert_LOAD_FAST
493493

494+
def _convert_LOAD_NAME(self, arg):
495+
return self._lookupName(arg, self.names)
496+
494497
def _convert_NAME(self, arg):
498+
self._lookupName(arg, self.varnames)
495499
return self._lookupName(arg, self.names)
496-
_convert_LOAD_NAME = _convert_NAME
497500
_convert_STORE_NAME = _convert_NAME
498501
_convert_DELETE_NAME = _convert_NAME
499502
_convert_IMPORT_NAME = _convert_NAME

0 commit comments

Comments
 (0)