gh-93223: More aggressive Jump-To-Jump elimination (GH-93229)

This commit is contained in:
Dennis Sweeney 2022-05-27 06:17:59 -04:00 committed by GitHub
parent 5e34b494a0
commit ddc4a782d3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 105 additions and 98 deletions

View file

@ -8706,7 +8706,7 @@ jump_thread(struct instr *inst, struct instr *target, int opcode)
assert(is_jump(target));
// bpo-45773: If inst->i_target == target->i_target, then nothing actually
// changes (and we fall into an infinite loop):
if (inst->i_lineno == target->i_lineno &&
if ((inst->i_lineno == target->i_lineno || target->i_lineno == -1) &&
inst->i_target != target->i_target)
{
inst->i_target = target->i_target;