Branch: refs/heads/davem/goto_xsub
  Home:   https://github.com/Perl/perl5
  Commit: 0d68f5d6e70e79f958c8c4fa2718acc75afb4663
      
https://github.com/Perl/perl5/commit/0d68f5d6e70e79f958c8c4fa2718acc75afb4663
  Author: David Mitchell <[email protected]>
  Date:   2026-02-18 (Wed, 18 Feb 2026)

  Changed paths:
    M pp_ctl.c
    M t/op/goto_xs.t

  Log Message:
  -----------
  goto: impose scalar context on XSUB return values

GH #24212

In something like

    my $ret = an_xsub();

pp_entersub() itself, since 5.001, imposes scalar context if necessary
on the return value(s) from the XSUB: by popping all but the top item in
the return list, or pushing undef if none.

However for this:

    sub wrap { goto an_xsub(); }
    my $ret = wrap();

pp_goto() hasn't been doing the same, resulting in stack underflow or
the wrong number args returned etc. Somehow no one noticed this for 32
years.

This commit fixes that by more or less copying the XSUB scalar context
fixup code as-is from pp_entersub() to pp_goto().


  Commit: 2148bacd185d23a5064f23b1e49b838c135c7440
      
https://github.com/Perl/perl5/commit/2148bacd185d23a5064f23b1e49b838c135c7440
  Author: David Mitchell <[email protected]>
  Date:   2026-02-18 (Wed, 18 Feb 2026)

  Changed paths:
    M pod/perldelta.pod

  Log Message:
  -----------
  perldelta for GH #24212 fix


Compare: https://github.com/Perl/perl5/compare/e8bda600573e...2148bacd185d

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

Reply via email to