Skip to content

Commit 69419b0

Browse files
fix comments
1 parent 2808c53 commit 69419b0

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

‎Python/flowgraph.c‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4161,14 +4161,17 @@ _PyCfg_OptimizedCfgToInstructionSequence(cfg_builder *g,
41614161
RETURN_IF_ERROR(normalize_jumps(g));
41624162
assert(no_redundant_jumps(g));
41634163

4164-
/* Can't modify the bytecode after inserting instructions that produce
4165-
* borrowed references.
4164+
/* After this point the bytecode may only be modified in ways that
4165+
* preserve the borrowed references computed here.
4166+
*
4167+
* NOTE: keep the passes below in sync with _PyCompile_OptimizeCfg().
41664168
*/
41674169
RETURN_IF_ERROR(optimize_load_fast(g));
41684170

41694171
/* Superinstructions are inserted after optimize_load_fast() so that a
41704172
* LOAD_FAST which can be borrowed is converted to LOAD_FAST_BORROW
4171-
* instead of being fused into a STORE_FAST_LOAD_FAST. */
4173+
* instead of being fused into a STORE_FAST_LOAD_FAST. Fusing adjacent
4174+
* instructions does not change which references are borrowed. */
41724175
RETURN_IF_ERROR(insert_superinstructions(g));
41734176

41744177
/* Can't modify the bytecode after computing jump offsets. */
@@ -4263,6 +4266,7 @@ _PyCompile_OptimizeCfg(PyObject *seq, PyObject *consts, int nlocals)
42634266
goto error;
42644267
}
42654268

4269+
/* NOTE: keep in sync with _PyCfg_OptimizedCfgToInstructionSequence(). */
42664270
if (optimize_load_fast(g) != SUCCESS) {
42674271
goto error;
42684272
}

0 commit comments

Comments
 (0)