GH-106008: Make implicit boolean conversions explicit (GH-106003)

This commit is contained in:
Brandt Bucher 2023-06-29 13:49:54 -07:00 committed by GitHub
parent 6e9f83d9ae
commit 7b2d94d875
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
20 changed files with 1728 additions and 1152 deletions

View file

@ -87,9 +87,9 @@ def_op('CACHE', 0)
def_op('POP_TOP', 1)
def_op('PUSH_NULL', 2)
def_op('INTERPRETER_EXIT', 3)
def_op('END_FOR', 4)
def_op('END_SEND', 5)
def_op('TO_BOOL', 6)
def_op('NOP', 9)
@ -142,6 +142,7 @@ def_op('RETURN_GENERATOR', 75)
def_op('RETURN_VALUE', 83)
def_op('SETUP_ANNOTATIONS', 85)
def_op('LOAD_LOCALS', 87)
def_op('POP_EXCEPT', 89)
@ -171,6 +172,7 @@ hascompare.append(107)
name_op('IMPORT_NAME', 108) # Index in name list
name_op('IMPORT_FROM', 109) # Index in name list
jrel_op('JUMP_FORWARD', 110) # Number of words to skip
jrel_op('POP_JUMP_IF_FALSE', 114)
jrel_op('POP_JUMP_IF_TRUE', 115)
name_op('LOAD_GLOBAL', 116) # Index in name list
@ -209,7 +211,6 @@ name_op('LOAD_SUPER_ATTR', 141)
def_op('CALL_FUNCTION_EX', 142) # Flags
def_op('LOAD_FAST_AND_CLEAR', 143) # Local variable number
haslocal.append(143)
def_op('EXTENDED_ARG', 144)
EXTENDED_ARG = 144
def_op('LIST_APPEND', 145)
@ -238,7 +239,6 @@ def_op('KW_NAMES', 172)
hasconst.append(172)
def_op('CALL_INTRINSIC_1', 173)
def_op('CALL_INTRINSIC_2', 174)
name_op('LOAD_FROM_DICT_OR_GLOBALS', 175)
def_op('LOAD_FROM_DICT_OR_DEREF', 176)
hasfree.append(176)
@ -404,6 +404,10 @@ _cache_format = {
"JUMP_BACKWARD": {
"counter": 1,
},
"TO_BOOL": {
"counter": 1,
"version": 2,
},
}
_inline_cache_entries = [