Skip to content

Commit 6b533a6

Browse files
authored
gh-125039: Make this_instr/prev_instr const in cases generator (GH-125071)
1 parent 3024b16 commit 6b533a6

File tree

4 files changed

+79
-78
lines changed

4 files changed

+79
-78
lines changed

Lib/test/test_generated_cases.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,7 @@ def test_cache_effect(self):
450450
"""
451451
output = """
452452
TARGET(OP) {
453-
_Py_CODEUNIT *this_instr = frame->instr_ptr = next_instr;
453+
_Py_CODEUNIT* const this_instr = frame->instr_ptr = next_instr;
454454
(void)this_instr;
455455
next_instr += 4;
456456
INSTRUCTION_STATS(OP);
@@ -503,7 +503,7 @@ def test_macro_instruction(self):
503503
next_instr += 6;
504504
INSTRUCTION_STATS(OP);
505505
PREDICTED(OP);
506-
_Py_CODEUNIT *this_instr = next_instr - 6;
506+
_Py_CODEUNIT* const this_instr = next_instr - 6;
507507
(void)this_instr;
508508
_PyStackRef left;
509509
_PyStackRef right;
@@ -536,7 +536,7 @@ def test_macro_instruction(self):
536536
}
537537
538538
TARGET(OP1) {
539-
_Py_CODEUNIT *this_instr = frame->instr_ptr = next_instr;
539+
_Py_CODEUNIT* const this_instr = frame->instr_ptr = next_instr;
540540
(void)this_instr;
541541
next_instr += 2;
542542
INSTRUCTION_STATS(OP1);
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Make ``this_instr`` and ``prev_instr`` const in cases generator.

0 commit comments

Comments
 (0)