diff options
author | Mark Shannon <mark@hotpy.org> | 2022-03-17 16:14:57 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-17 16:14:57 (GMT) |
commit | 3011a097bd9500c007bd8b8d005edeea895f6b44 (patch) | |
tree | d2637ab682e1265eaf23316add1039b3829abb19 /Lib/dis.py | |
parent | ef1327e3b622e0cafdf8bfc1f480fed0dd386be6 (diff) | |
download | cpython-3011a097bd9500c007bd8b8d005edeea895f6b44.zip cpython-3011a097bd9500c007bd8b8d005edeea895f6b44.tar.gz cpython-3011a097bd9500c007bd8b8d005edeea895f6b44.tar.bz2 |
Use low bit of LOAD_GLOBAL's oparg to indicate whether it should push an additional NULL. (GH-31933)
Diffstat (limited to 'Lib/dis.py')
-rw-r--r-- | Lib/dis.py | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -28,6 +28,7 @@ MAKE_FUNCTION = opmap['MAKE_FUNCTION'] MAKE_FUNCTION_FLAGS = ('defaults', 'kwdefaults', 'annotations', 'closure') LOAD_CONST = opmap['LOAD_CONST'] +LOAD_GLOBAL = opmap['LOAD_GLOBAL'] BINARY_OP = opmap['BINARY_OP'] CACHE = opmap["CACHE"] @@ -430,7 +431,12 @@ def _get_instructions_bytes(code, varname_from_oparg=None, if op in hasconst: argval, argrepr = _get_const_info(op, arg, co_consts) elif op in hasname: - argval, argrepr = _get_name_info(arg, get_name) + if op == LOAD_GLOBAL: + argval, argrepr = _get_name_info(arg//2, get_name) + if (arg & 1) and argrepr: + argrepr = "NULL + " + argrepr + else: + argval, argrepr = _get_name_info(arg, get_name) elif op in hasjabs: argval = arg*2 argrepr = "to " + repr(argval) |