Branch: refs/heads/blead
  Home:   https://github.com/Perl/perl5
  Commit: a2b66c25985f6e0bb428250eaa31ef1d288f7785
      
https://github.com/Perl/perl5/commit/a2b66c25985f6e0bb428250eaa31ef1d288f7785
  Author: Tony Cook <t...@develop-help.com>
  Date:   2024-03-25 (Mon, 25 Mar 2024)

  Changed paths:
    M builtin.c
    M lib/builtin.t

  Log Message:
  -----------
  prepare_export_lexical: save PL_comppad safely

When the pad being saved and the pad for PL_compcv is the same,
in some cases the actual exports would result in reallocating the
AvARRAY() for the saved PL_comppad.

The LEAVE in finish_export_lexical() would restore the old PL_comppad
(which is fine) and the pre-reallocation PL_curpad (which isn't fine).

This would later panic.

SAVECOMPPAD; restores PL_comppad on LEAVE and then restores PL_curpad
from PL_comppad, preventing the desync between those values.

It's unclear to me why only the save_BEGINs; causes this, but the fix
does fix a real problem and prevents the panics that I'm aware of
here.

Fixes #21981



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

Reply via email to