[3.11] gh-94485: Set line number of module's RESUME instruction to 0 … · python/cpython@1bfe83a (original) (raw)
`@@ -272,7 +272,7 @@ def bug42562():
`
272
272
`expr_str = "x + 1"
`
273
273
``
274
274
`dis_expr_str = """\
`
275
``
`-
RESUME 0
`
``
275
`+
0 RESUME 0
`
276
276
``
277
277
` 1 LOAD_NAME 0 (x)
`
278
278
` LOAD_CONST 0 (1)
`
`@@ -283,7 +283,7 @@ def bug42562():
`
283
283
`simple_stmt_str = "x = x + 1"
`
284
284
``
285
285
`dis_simple_stmt_str = """\
`
286
``
`-
RESUME 0
`
``
286
`+
0 RESUME 0
`
287
287
``
288
288
` 1 LOAD_NAME 0 (x)
`
289
289
` LOAD_CONST 0 (1)
`
`@@ -302,7 +302,7 @@ def bug42562():
`
302
302
`# leading newline is for a reason (tests lineno)
`
303
303
``
304
304
`dis_annot_stmt_str = """\
`
305
``
`-
RESUME 0
`
``
305
`+
0 RESUME 0
`
306
306
``
307
307
` 2 SETUP_ANNOTATIONS
`
308
308
` LOAD_CONST 0 (1)
`
`@@ -342,7 +342,7 @@ def bug42562():
`
342
342
`# Trailing newline has been deliberately omitted
`
343
343
``
344
344
`dis_compound_stmt_str = """\
`
345
``
`-
RESUME 0
`
``
345
`+
0 RESUME 0
`
346
346
``
347
347
` 1 LOAD_CONST 0 (0)
`
348
348
` STORE_NAME 0 (x)
`
`@@ -954,7 +954,7 @@ def test_super_instructions(self):
`
954
954
`@cpython_only
`
955
955
`def test_binary_specialize(self):
`
956
956
`binary_op_quicken = """\
`
957
``
`-
0 RESUME_QUICK 0
`
``
957
`+
0 0 RESUME_QUICK 0
`
958
958
``
959
959
` 1 2 LOAD_NAME 0 (a)
`
960
960
` 4 LOAD_NAME 1 (b)
`
`@@ -972,7 +972,7 @@ def test_binary_specialize(self):
`
972
972
`self.do_disassembly_compare(got, binary_op_quicken % "BINARY_OP_ADD_UNICODE 0 (+)", True)
`
973
973
``
974
974
`binary_subscr_quicken = """\
`
975
``
`-
0 RESUME_QUICK 0
`
``
975
`+
0 0 RESUME_QUICK 0
`
976
976
``
977
977
` 1 2 LOAD_NAME 0 (a)
`
978
978
` 4 LOAD_CONST 0 (0)
`
`@@ -992,7 +992,7 @@ def test_binary_specialize(self):
`
992
992
`@cpython_only
`
993
993
`def test_load_attr_specialize(self):
`
994
994
`load_attr_quicken = """\
`
995
``
`-
0 RESUME_QUICK 0
`
``
995
`+
0 0 RESUME_QUICK 0
`
996
996
``
997
997
` 1 2 LOAD_CONST 0 ('a')
`
998
998
` 4 LOAD_ATTR_SLOT 0 (class)
`
`@@ -1006,7 +1006,7 @@ def test_load_attr_specialize(self):
`
1006
1006
`@cpython_only
`
1007
1007
`def test_call_specialize(self):
`
1008
1008
`call_quicken = """\
`
1009
``
`-
0 RESUME_QUICK 0
`
``
1009
`+
0 0 RESUME_QUICK 0
`
1010
1010
``
1011
1011
` 1 2 PUSH_NULL
`
1012
1012
` 4 LOAD_NAME 0 (str)
`
`@@ -1595,7 +1595,7 @@ def test_co_positions(self):
`
1595
1595
`for instr in dis.get_instructions(code)
`
1596
1596
` ]
`
1597
1597
`expected = [
`
1598
``
`-
(None, None, None, None),
`
``
1598
`+
(0, 1, 0, 0),
`
1599
1599
` (1, 1, 0, 1),
`
1600
1600
` (1, 1, 0, 1),
`
1601
1601
` (2, 2, 2, 3),
`