Branch: refs/heads/davem/goto_xsub
Home: https://github.com/Perl/perl5
Commit: 79eadee3c3c4c88532854fba6a5dcc946aa35886
https://github.com/Perl/perl5/commit/79eadee3c3c4c88532854fba6a5dcc946aa35886
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: a38e38cd46dc9c4268412710a4f3cab2f9ef3c88
https://github.com/Perl/perl5/commit/a38e38cd46dc9c4268412710a4f3cab2f9ef3c88
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/2148bacd185d...a38e38cd46dc
To unsubscribe from these emails, change your notification settings at
https://github.com/Perl/perl5/settings/notifications