In perl.git, the branch blead has been updated

<http://perl5.git.perl.org/perl.git/commitdiff/323dbd00f273d31c4a30b1de1a1201aea0f1b778?hp=8de1da66eed8375a168c7e1b37c6747fce33d856>

- Log -----------------------------------------------------------------
commit 323dbd00f273d31c4a30b1de1a1201aea0f1b778
Author: Aaron Crane <a...@cpan.org>
Date:   Wed Jan 4 20:02:45 2017 +0000

    RT#130496: assertion failure for '{}->$x' on undefined $x
-----------------------------------------------------------------------

Summary of changes:
 pp_hot.c      | 2 +-
 t/op/method.t | 9 ++++++++-
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/pp_hot.c b/pp_hot.c
index dd2c611e1f..97d46f6511 100644
--- a/pp_hot.c
+++ b/pp_hot.c
@@ -4465,7 +4465,7 @@ S_opmethod_stash(pTHX_ SV* meth)
                     && SvOBJECT(ob))))
     {
        Perl_croak(aTHX_ "Can't call method \"%" SVf "\" on unblessed 
reference",
-                  SVfARG((SvPVX(meth) == PL_isa_DOES)
+                  SVfARG((SvPOK(meth) && SvPVX(meth) == PL_isa_DOES)
                                         ? newSVpvs_flags("DOES", SVs_TEMP)
                                         : meth));
     }
diff --git a/t/op/method.t b/t/op/method.t
index 8795734ae4..ef181c4ce0 100644
--- a/t/op/method.t
+++ b/t/op/method.t
@@ -13,7 +13,7 @@ BEGIN {
 use strict;
 no warnings 'once';
 
-plan(tests => 150);
+plan(tests => 151);
 
 @A::ISA = 'B';
 @B::ISA = 'C';
@@ -704,6 +704,13 @@ SKIP: {
                   "check unknown import() methods don't corrupt the stack");
 }
 
+# RT#130496: assertion failure when looking for a method of undefined name
+# on an unblessed reference
+fresh_perl_is('eval { {}->$x }; print $@;',
+              "Can't call method \"\" on unblessed reference at - line 1.",
+              {},
+              "no crash with undef method name on unblessed ref");
+
 __END__
 #FF9900
 #F78C08

--
Perl5 Master Repository

Reply via email to