Branch: refs/heads/davem/goto_xsub
  Home:   https://github.com/Perl/perl5
  Commit: 9771098c918779adade866c3bc212a0f6408af9f
      
https://github.com/Perl/perl5/commit/9771098c918779adade866c3bc212a0f6408af9f
  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: e8bda600573ee2fdcd1a571a7b4ffc6071b455f5
      
https://github.com/Perl/perl5/commit/e8bda600573ee2fdcd1a571a7b4ffc6071b455f5
  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/9771098c9187%5E...e8bda600573e

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

Reply via email to