This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
pp_ctl.c:pp_goto: Cast a boolean properly
authorFather Chrysostomos <sprout@cpan.org>
Tue, 10 Sep 2013 15:17:51 +0000 (08:17 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Tue, 10 Sep 2013 15:17:51 +0000 (08:17 -0700)
Otherwise we might end up using AvARRAY on a tied array.

pp_ctl.c

index bab301e..5eebe24 100644 (file)
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -2896,7 +2896,7 @@ PP(pp_goto) /* also pp_dump */
                SV **newsp;
                I32 gimme;
                const SSize_t items = arg ? AvFILL(arg) + 1 : 0;
-               const bool m = arg ? SvRMAGICAL(arg) : 0;
+               const bool m = arg ? cBOOL(SvRMAGICAL(arg)) : 0;
                SV** mark;
 
                 PERL_UNUSED_VAR(newsp);