]> git.vpit.fr Git - perl/modules/indirect.git/blobdiff - indirect.xs
Really fix the "${\(new Hlagh)}" bug by ensuring that the kid of a rv2sv is a SVOP...
[perl/modules/indirect.git] / indirect.xs
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;