Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > perl.perl5.changes > #34308

[Perl/perl5] 1189b8: S_clear_special_blocks - allow caller to notice th...

Newsgroups perl.perl5.changes
Date 2026-01-29 14:19 -0800
Message-ID <Perl/perl5/push/refs/heads/blead/b2b5c0-1189b8@github.com> (permalink)
Subject [Perl/perl5] 1189b8: S_clear_special_blocks - allow caller to notice th...
From perl5-changes@perl.org (Richard Leach via perl5-changes)

Show all headers | View raw


  Branch: refs/heads/blead
  Home:   https://github.com/Perl/perl5
  Commit: 1189b87114b9d300ea13976c5b5227fea0c6e1c7
      https://github.com/Perl/perl5/commit/1189b87114b9d300ea13976c5b5227fea0c6e1c7
  Author: Richard Leach <richardleach@users.noreply.github.com>
  Date:   2026-01-29 (Thu, 29 Jan 2026)

  Changed paths:
    M embed.fnc
    M op.c
    M proto.h
    M t/op/sub.t

  Log Message:
  -----------
  S_clear_special_blocks - allow caller to notice that cv has been freed

GH #16868: `use strict;END{{{{}}}}{END}END{e}` triggers an assertion failure:
```
perl​: op.c​:10342​: CV *Perl_newATTRSUB_x(I32, OP *, OP *, OP *, OP *,
_Bool)​: Assertion `!cv || evanescent || SvREFCNT((SV*)cv) != 0'
failed.
```

In the following block, `S_clear_special_blocks` frees `cv`, but doesn't signal
that it has done so to the caller. The caller continues to act as if `cv` had
not been freed.
```
        if (name) {
            if (PL_parser && PL_parser->error_count) {
                clear_special_blocks(name, gv, cv);
            }
```

This commit changes `S_clear_special_blocks` from a void function to
returning a CV*:
```
    return SvIS_FREED(cv) ? NULL : cv;
```
The caller now assigns the result of the call back to `cv`.

This causes the test case to croak:
```
Bareword "e" not allowed while "strict subs" in use at -e line 1.
Execution of -e aborted due to compilation errors.
```



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

Back to perl.perl5.changes | Previous | Next | Find similar | Unroll thread


Thread

[Perl/perl5] 1189b8: S_clear_special_blocks - allow caller to notice th... perl5-changes@perl.org (Richard Leach via perl5-changes) - 2026-01-29 14:19 -0800

csiph-web