This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Update Locale-Codes to CPAN version 3.35
[perl5.git] / universal.c
index 864558f..4b650c5 100644 (file)
@@ -294,7 +294,8 @@ A specialised variant of C<croak()> for emitting the usage message for xsubs
 works out the package name and subroutine name from C<cv>, and then calls
 C<croak()>.  Hence if C<cv> is C<&ouch::awk>, it would call C<croak> as:
 
-    Perl_croak(aTHX_ "Usage: %"SVf"::%"SVf"(%s)", "ouch" "awk", "eee_yow");
+ Perl_croak(aTHX_ "Usage: %"SVf"::%"SVf"(%s)", "ouch" "awk",
+                                                     "eee_yow");
 
 =cut
 */
@@ -903,7 +904,7 @@ XS(XS_re_regexp_pattern)
 {
     dXSARGS;
     REGEXP *re;
-    U8 const gimme = GIMME_V;
+    I32 const gimme = GIMME_V;
 
     EXTEND(SP, 2);
     SP -= items;
@@ -1049,6 +1050,7 @@ optimize_out_native_convert_function(pTHX_ OP* entersubop,
      * The code is mostly just cargo-culted from Memoize::Lift */
 
     OP *pushop, *argop;
+    OP *parent;
     SV* prototype = newSVpvs("$");
 
     PERL_UNUSED_ARG(protosv);
@@ -1056,27 +1058,28 @@ optimize_out_native_convert_function(pTHX_ OP* entersubop,
     assert(entersubop->op_type == OP_ENTERSUB);
 
     entersubop = ck_entersub_args_proto(entersubop, namegv, prototype);
+    parent = entersubop;
 
     SvREFCNT_dec(prototype);
 
     pushop = cUNOPx(entersubop)->op_first;
-    if (! pushop->op_sibling) {
+    if (! OpHAS_SIBLING(pushop)) {
+        parent = pushop;
         pushop = cUNOPx(pushop)->op_first;
     }
-    argop = pushop->op_sibling;
+    argop = OpSIBLING(pushop);
 
     /* Carry on without doing the optimization if it is not something we're
      * expecting, so continues to work */
     if (   ! argop
-        || ! argop->op_sibling
-        ||   argop->op_sibling->op_sibling
+        || ! OpHAS_SIBLING(argop)
+        ||   OpHAS_SIBLING(OpSIBLING(argop))
     ) {
         return entersubop;
     }
 
-    pushop->op_sibling = argop->op_sibling;
-    argop->op_sibling = NULL;
-    argop->op_lastsib = 1;
+    /* cut argop from the subtree */
+    (void)op_sibling_splice(parent, pushop, 1, NULL);
 
     op_free(entersubop);
     return argop;
@@ -1122,11 +1125,5 @@ Perl_boot_core_UNIVERSAL(pTHX)
 }
 
 /*
- * Local variables:
- * c-indentation-style: bsd
- * c-basic-offset: 4
- * indent-tabs-mode: nil
- * End:
- *
  * ex: set ts=8 sts=4 sw=4 et:
  */