From 249534c343ab758089ce40786709465e328c8b2d Mon Sep 17 00:00:00 2001 From: Florian Ragwitz Date: Tue, 16 Nov 2010 07:14:04 +0100 Subject: Check for deleted stashes when reporting var names The stash of the GV is what's being used to look up a global variables name. If the GV has no stash, we might as well give up early. This fixes a segfault because S_varname would later assume gv_fullname4 has resolved the glob's full name and try to use the svu_pv slot of the scalar returned, while all it got back was undef. --- sv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sv.c') diff --git a/sv.c b/sv.c index 57db4f4894..3d5dc68fa0 100644 --- a/sv.c +++ b/sv.c @@ -13695,7 +13695,7 @@ S_find_uninit_var(pTHX_ const OP *const obase, const SV *const uninit_sv, case OP_GVSV: gv = cGVOPx_gv(obase); - if (!gv || (match && GvSV(gv) != uninit_sv)) + if (!gv || (match && GvSV(gv) != uninit_sv) || !GvSTASH(gv)) break; return varname(gv, '$', 0, NULL, 0, FUV_SUBSCRIPT_NONE); -- cgit v1.2.1