8000 remove redundant assert and move another up to just after the value w… · python/cpython@bab900a · GitHub
[go: up one dir, main page]

Skip to content 8000

Commit bab900a

Browse files
committed
remove redundant assert and move another up to just after the value was calculated
1 parent 103c9ae commit bab900a

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

Python/compile.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7080,15 +7080,14 @@ stackdepth(basicblock *entryblock, int code_flags)
70807080
if (new_depth > maxdepth) {
70817081
maxdepth = new_depth;
70827082
}
7083-
assert(depth >= 0); /* invalid code or bug in stackdepth() */
70847083
if (HAS_TARGET(instr->i_opcode)) {
70857084
effect = stack_effect(instr->i_opcode, instr->i_oparg, 1);
70867085
assert(effect != PY_INVALID_STACK_EFFECT);
70877086
int target_depth = depth + effect;
7087+
assert(target_depth >= 0); /* invalid code or bug in stackdepth() */
70887088
if (target_depth > maxdepth) {
70897089
maxdepth = target_depth;
70907090
}
7091-
assert(target_depth >= 0); /* invalid code or bug in stackdepth() */
70927091
stackdepth_push(&sp, instr->i_target, target_depth);
70937092
}
70947093
depth = new_depth;

0 commit comments

Comments
 (0)
0