This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
overload.[hc] descriptions were swapped
[perl5.git] / util.c
diff --git a/util.c b/util.c
index e4e684c..607f480 100644 (file)
--- a/util.c
+++ b/util.c
@@ -1529,6 +1529,7 @@ S_invoke_exception_hook(pTHX_ SV *ex, bool warn)
        SV *exarg;
 
        ENTER;
+       save_re_context();
        if (warn) {
            SAVESPTR(*hook);
            *hook = NULL;
@@ -1937,7 +1938,10 @@ Perl_vwarner(pTHX_ U32  err, const char* pat, va_list* args)
 {
     dVAR;
     PERL_ARGS_ASSERT_VWARNER;
-    if (PL_warnhook == PERL_WARNHOOK_FATAL || ckDEAD(err)) {
+    if (
+        (PL_warnhook == PERL_WARNHOOK_FATAL || ckDEAD(err)) &&
+        !(PL_in_eval & EVAL_KEEPERR)
+    ) {
        SV * const msv = vmess(pat, args);
 
        if (PL_parser && PL_parser->error_count) {
@@ -4419,16 +4423,15 @@ Perl_parse_unicode_opts(pTHX_ const char **popt)
        if (isDIGIT(*p)) {
             const char* endptr;
             UV uv;
-            if (grok_atoUV(p, &uv, &endptr)
-                && uv <= U32_MAX
-                && (p = endptr)
-                && *p && *p != '\n' && *p != '\r'
-            ) {
+            if (grok_atoUV(p, &uv, &endptr) && uv <= U32_MAX) {
                 opt = (U32)uv;
-                if (isSPACE(*p))
-                    goto the_end_of_the_opts_parser;
-                else
-                    Perl_croak(aTHX_ "Unknown Unicode option letter '%c'", *p);
+                p = endptr;
+                if (p && *p && *p != '\n' && *p != '\r') {
+                    if (isSPACE(*p))
+                        goto the_end_of_the_opts_parser;
+                    else
+                        Perl_croak(aTHX_ "Unknown Unicode option letter '%c'", *p);
+                }
             }
         }
         else {
@@ -4512,16 +4515,10 @@ Perl_seed(pTHX)
     int fd;
 #endif
     U32 u;
-#ifdef VMS
-    /* when[] = (low 32 bits, high 32 bits) of time since epoch
-     * in 100-ns units, typically incremented ever 10 ms.        */
-    unsigned int when[2];
-#else
-#  ifdef HAS_GETTIMEOFDAY
+#ifdef HAS_GETTIMEOFDAY
     struct timeval when;
-#  else
+#else
     Time_t when;
-#  endif
 #endif
 
 /* This test is an escape hatch, this symbol isn't set by Configure. */
@@ -4543,17 +4540,12 @@ Perl_seed(pTHX)
     }
 #endif
 
-#ifdef VMS
-    _ckvmssts(sys$gettim(when));
-    u = (U32)SEED_C1 * when[0] + (U32)SEED_C2 * when[1];
-#else
-#  ifdef HAS_GETTIMEOFDAY
+#ifdef HAS_GETTIMEOFDAY
     PerlProc_gettimeofday(&when,NULL);
     u = (U32)SEED_C1 * when.tv_sec + (U32)SEED_C2 * when.tv_usec;
-#  else
+#else
     (void)time(&when);
     u = (U32)SEED_C1 * when;
-#  endif
 #endif
     u += SEED_C3 * (U32)PerlProc_getpid();
     u += SEED_C4 * (U32)PTR2UV(PL_stack_sp);