Branch: refs/heads/blead
  Home:   https://github.com/Perl/perl5
  Commit: 73c046c733ed76aa41faecfb7f089ad8cc553a4d
      
https://github.com/Perl/perl5/commit/73c046c733ed76aa41faecfb7f089ad8cc553a4d
  Author: Richard Leach <richardle...@users.noreply.github.com>
  Date:   2025-09-05 (Fri, 05 Sep 2025)

  Changed paths:
    M peep.c
    M t/perf/opcount.t

  Log Message:
  -----------
  peep.c: Only remove expected empty if/else blocks structures

The expected OP tree structures for empty blocks fit for removal was:
```
  +-- stub
```
or
```
  +-- scope
    |
    +-- stub
```

GH #23505 showed that `{ BEGIN {} }` blocks will also generate the likes of:
```
  +--scope
    |
    +--stub
    |
    +--null (ex-nextstate)
```

This commit does the minimal possible to fix this bug - the peephole optimizer
now checks for the expected cases and ignores anything else.

Future commits may build on this to remove this additional type of structure.
Additional tests have been added now and give a useful structure for future
commit tests to fit into.



To unsubscribe from these emails, change your notification settings at 
https://github.com/Perl/perl5/settings/notifications

Reply via email to