@@ -1057,16 +1057,16 @@ def test_conditional_jump_forward_non_const_condition(self):
1057
1057
expected_insts = [
1058
1058
('LOAD_NAME' , 1 , 11 ),
1059
1059
('POP_JUMP_IF_TRUE' , lbl := self .Label (), 12 ),
1060
- ('LOAD_CONST' , 1 , 13 ),
1060
+ ('LOAD_CONST' , 0 , 13 ),
1061
1061
('RETURN_VALUE' , None , 13 ),
1062
1062
lbl ,
1063
- ('LOAD_CONST' , 2 , 14 ),
1063
+ ('LOAD_CONST' , 1 , 14 ),
1064
1064
('RETURN_VALUE' , None , 14 ),
1065
1065
]
1066
1066
self .cfg_optimization_test (insts ,
1067
1067
expected_insts ,
1068
1068
consts = [0 , 1 , 2 , 3 , 4 ],
1069
- expected_consts = [0 , 2 , 3 ])
1069
+ expected_consts = [2 , 3 ])
1070
1070
1071
1071
def test_list_exceeding_stack_use_guideline (self ):
1072
1072
def f ():
@@ -1107,10 +1107,10 @@ def test_multiple_foldings(self):
1107
1107
('RETURN_VALUE' , None , 0 )
1108
1108
]
1109
1109
after = [
1110
- ('LOAD_CONST' , 1 , 0 ),
1110
+ ('LOAD_CONST' , 0 , 0 ),
1111
1111
('RETURN_VALUE' , None , 0 )
1112
1112
]
1113
- self .cfg_optimization_test (before , after , consts = [], expected_consts = [(2 ,), ( 1 , 2 )])
1113
+ self .cfg_optimization_test (before , after , consts = [], expected_consts = [(1 , 2 )])
1114
1114
1115
1115
def test_build_empty_tuple (self ):
1116
1116
before = [
@@ -1277,13 +1277,13 @@ def test_conditional_jump_forward_const_condition(self):
1277
1277
expected_insts = [
1278
1278
('NOP' , None , 11 ),
1279
1279
('NOP' , None , 12 ),
1280
- ('LOAD_CONST' , 1 , 14 ),
1280
+ ('LOAD_CONST' , 0 , 14 ),
1281
1281
('RETURN_VALUE' , None , 14 ),
1282
1282
]
1283
1283
self .cfg_optimization_test (insts ,
1284
1284
expected_insts ,
1285
1285
consts = [0 , 1 , 2 , 3 , 4 ],
1286
- expected_consts = [0 , 3 ])
1286
+ expected_consts = [3 ])
1287
1287
1288
1288
def test_conditional_jump_backward_non_const_condition (self ):
1289
1289
insts = [
@@ -1322,18 +1322,18 @@ def test_except_handler_label(self):
1322
1322
insts = [
1323
1323
('SETUP_FINALLY' , handler := self .Label (), 10 ),
1324
1324
('POP_BLOCK' , None , - 1 ),
1325
- ('LOAD_CONST' , 1 , 11 ),
1325
+ ('LOAD_CONST' , 0 , 11 ),
1326
1326
('RETURN_VALUE' , None , 11 ),
1327
1327
handler ,
1328
- ('LOAD_CONST' , 2 , 12 ),
1328
+ ('LOAD_CONST' , 1 , 12 ),
1329
1329
('RETURN_VALUE' , None , 12 ),
1330
1330
]
1331
1331
expected_insts = [
1332
1332
('SETUP_FINALLY' , handler := self .Label (), 10 ),
1333
- ('LOAD_CONST' , 1 , 11 ),
1333
+ ('LOAD_CONST' , 0 , 11 ),
1334
1334
('RETURN_VALUE' , None , 11 ),
1335
1335
handler ,
1336
- ('LOAD_CONST' , 2 , 12 ),
1336
+ ('LOAD_CONST' , 1 , 12 ),
1337
1337
('RETURN_VALUE' , None , 12 ),
1338
1338
]
1339
1339
self .cfg_optimization_test (insts , expected_insts , consts = list (range (5 )))
0 commit comments