This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Integrate the API from:
[perl5.git] / ext / Opcode / Opcode.xs
index 067ffdb..95d3495 100644 (file)
@@ -268,9 +268,9 @@ PPCODE:
    
     hv = gv_stashpv(Package, GV_ADDWARN); /* should exist already      */
 
-    if (strNE(HvNAME(hv),"main")) {
-        Safefree(HvNAME(hv));         
-        HvNAME(hv) = savepv("main"); /* make it think it's in main:: */
+    if (strNE(HvNAME_get(hv),"main")) {
+        /* make it think it's in main:: */
+       hv_name_set(hv, "main", 4, 0);
         hv_store(hv,"_",1,(SV *)PL_defgv,0);  /* connect _ to global */
         SvREFCNT_inc((SV *)PL_defgv);  /* want to keep _ around! */
     }