This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
regcomp.c:current_re_engine: Avoid %^H lookup when possible
[perl5.git] / regcomp.c
index e0787e1..931f8fb 100644 (file)
--- a/regcomp.c
+++ b/regcomp.c
@@ -4881,7 +4881,7 @@ Perl_current_re_engine(pTHX)
        HV * const table = GvHV(PL_hintgv);
        SV **ptr;
 
-       if (!table)
+       if (!table || !(PL_hints & HINT_LOCALIZE_HH))
            return &PL_core_reg_engine;
        ptr = hv_fetchs(table, "regcomp", FALSE);
        if ( !(ptr && SvIOK(*ptr) && SvIV(*ptr)))