]> git.vpit.fr Git - perl/modules/indirect.git/commitdiff
Really fix the "${\(new Hlagh)}" bug by ensuring that the kid of a rv2sv is a SVOP...
authorVincent Pit <vince@profvince.com>
Sat, 6 Dec 2008 01:18:38 +0000 (02:18 +0100)
committerVincent Pit <vince@profvince.com>
Sat, 6 Dec 2008 01:18:38 +0000 (02:18 +0100)
indirect.xs
t/10-good.t

index ad4a23f4837d288243c6056146d3b75b61abcfb7..c89c8b9d0080aee0aec716c668885e640674c65c 100644 (file)
@@ -203,8 +203,9 @@ STATIC OP *indirect_ck_rv2sv(pTHX_ OP *o) {
   SV *sv;
   const char *name = NULL, *s;
   STRLEN len;
+  OPCODE type = op->op_type;
 
-  switch (op->op_type) {
+  switch (type) {
    case OP_GV:
    case OP_GVSV: {
     GV *gv = cGVOPx_gv(op);
@@ -212,12 +213,12 @@ STATIC OP *indirect_ck_rv2sv(pTHX_ OP *o) {
     len  = GvNAMELEN(gv);
     break;
    }
-   default: {
-    SV *sv = cSVOPx_sv(op);
-    if (SvPOK(sv) && (SvTYPE(sv) >= SVt_PV))
-     name = SvPV_const(sv, len);
-    break;
-   }
+   default:
+    if ((PL_opargs[type] & OA_CLASS_MASK) == OA_SVOP) {
+     SV *sv = cSVOPx_sv(op);
+     if (SvPOK(sv) && (SvTYPE(sv) >= SVt_PV))
+      name = SvPV_const(sv, len);
+    }
   }
   if (!name)
    goto done;
index 91b1ac04d0360b56a2a156111e6b8cd660aa1f4b..d428d1fdf600d79f0ea08d7d9c12f93ab5fe33d5 100644 (file)
@@ -171,7 +171,7 @@ print $z "hlagh\n";
 print STDOUT "bananananananana\n";
 ####
 $x->foo($pkg->$cb)
-#### "seems to segfault with strict libc implementations" #
+####
 $obj = "apple ${\(new Hlagh)} pear"
 ####
 $obj = "apple @{[new Hlagh]} pear"