Skip to content

Conversation

@richardleach
Copy link
Contributor

An OP_STUB in void context is functionally identical to an OP_NULL.

It's straightforward and safe to transform an OP_STUB into an OP_NULL by adding an extra case within Perl_scalarvoid. In doing so:


  • This set of changes does not require a perldelta entry.

An OP_STUB in void context is functionally identical to an OP_NULL.

It's straightforward and safe to transform an OP_STUB into an OP_NULL
by adding an extra `case` within `Perl_scalarvoid`. In doing so:
* The redundant OPs are more likely to be omitted from the op_next chain.
* The OP tree is more consistent with `assert` expectations in `Perl_rpeep`.
  (The programs in GH Perl#17228 no longer trigger assertions.)
Copy link
Contributor

@tonycoz tonycoz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks reasonable.

I thought some CPAN modules might have troubles, but the only ones I could see that weren't obsolete and check for OP_STUB (lots create OP_STUB) were Want, autovivification and Scope::Upper and they all built/tested fine with this change.

@richardleach richardleach merged commit 7c8d192 into Perl:blead Sep 25, 2025
33 checks passed
@richardleach richardleach deleted the gh17228 branch September 25, 2025 15:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

op.c:16388: Perl_rpeep: Assertion `oldop->op_type == OP_NEXTSTATE || oldop->op_type == OP_DBSTATE' failed.

2 participants