This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Update Log::Messge::Simple to 0.04 (was: Re: Code freeze)
[perl5.git] / regcomp.c
index 603fe5b..3ad5d8c 100644 (file)
--- a/regcomp.c
+++ b/regcomp.c
@@ -1172,7 +1172,7 @@ is the recommended Unicode-aware way of saying
            SvUTF8_on(zlopp);                                              \
            av_push(revcharmap, zlopp);                                    \
        } else {                                                           \
-           char ooooff = uvc;                                             \
+           char ooooff = (char)uvc;                                               \
            av_push(revcharmap, newSVpvn(&ooooff, 1));                     \
        }                                                                  \
         } STMT_END
@@ -4944,9 +4944,13 @@ Perl_reg_named_buff_exists(pTHX_ REGEXP * const rx, SV * const key,
 SV*
 Perl_reg_named_buff_firstkey(pTHX_ REGEXP * const rx, const U32 flags)
 {
-    (void)hv_iterinit(rx->paren_names);
+    if ( rx && rx->paren_names ) {
+       (void)hv_iterinit(rx->paren_names);
 
-    return CALLREG_NAMED_BUFF_NEXTKEY(rx, NULL, flags & ~RXapif_FIRSTKEY);
+       return CALLREG_NAMED_BUFF_NEXTKEY(rx, NULL, flags & ~RXapif_FIRSTKEY);
+    } else {
+       return FALSE;
+    }
 }
 
 SV*
@@ -6504,7 +6508,7 @@ S_reg_namedseq(pTHX_ RExC_state_t *pRExC_state, UV *valuep)
             *valuep = cp;
             return NULL;
         }
-       string = cp;
+       string = (char)cp;
         sv_str= newSVpvn(&string, 1);
     } else {
         /* fetch the charnames handler for this scope */