From: Nicholas Clark Date: Sun, 11 Jun 2006 20:52:36 +0000 (+0000) Subject: A little more work needed to get ext/re/t/re.t test 14 (no segv) passing X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=e7f343b6de977b5993b7a5a4707f5051ea388ff2;p=p5sagit%2Fp5-mst-13.2.git A little more work needed to get ext/re/t/re.t test 14 (no segv) passing with PERL_DESTRUCT_LEVEL=2. p4raw-id: //depot/perl@28378 --- diff --git a/gv.c b/gv.c index 746b2bb..1c8d981 100644 --- a/gv.c +++ b/gv.c @@ -943,10 +943,16 @@ Perl_gv_fetchpvn_flags(pTHX_ const char *nambeg, STRLEN full_len, I32 flags, : sv_type == SVt_PVAV ? "@" : sv_type == SVt_PVHV ? "%" : ""), name); + GV *gv; if (USE_UTF8_IN_NAMES) SvUTF8_on(err); qerror(err); - stash = GvHV(gv_fetchpvn_flags("::", 8, GV_ADDMULTI, SVt_PVHV)); + gv = gv_fetchpvn_flags("::", 8, GV_ADDMULTI, SVt_PVHV); + if(!gv) { + /* symbol table under destruction */ + return NULL; + } + stash = GvHV(gv); } else return NULL; diff --git a/regcomp.h b/regcomp.h index 7310d3c..d06c767 100644 --- a/regcomp.h +++ b/regcomp.h @@ -550,9 +550,10 @@ typedef struct _reg_ac_data reg_ac_data; #define DEBUG_TRIE_COMPILE_MORE_r(x) \ DEBUG_TRIE_COMPILE_r( if (SvIV(re_debug_flags) & RE_DEBUG_TRIE_MORE) x ) +/* get_sv() can return NULL during global destruction. */ #define GET_RE_DEBUG_FLAGS DEBUG_r( \ re_debug_flags=get_sv(RE_DEBUG_FLAGS, 1); \ - if (!SvIOK(re_debug_flags)) { \ + if (re_debug_flags && !SvIOK(re_debug_flags)) { \ sv_setiv(re_debug_flags, RE_DEBUG_COMPILE | RE_DEBUG_EXECUTE ); \ } \ )