From 54b3381a00e201e4524d82138e335c8c8c4c37f5 Mon Sep 17 00:00:00 2001 From: "Paul \"LeoNerd\" Evans" Date: Fri, 13 Jan 2023 19:57:22 +0000 Subject: get_{av,hv} should ignore SVf_UTF8 when testing if flags == 0 --- perl.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'perl.c') diff --git a/perl.c b/perl.c index 14b3d1b634..a8d84d83da 100644 --- a/perl.c +++ b/perl.c @@ -2845,7 +2845,8 @@ Returns the AV of the specified Perl global or package array with the given name (so it won't work on lexical variables). C are passed to C. If C is set and the Perl variable does not exist then it will be created. If C is zero -and the variable does not exist then NULL is returned. +(ignoring C) and the variable does not exist then C is +returned. Perl equivalent: C<@{"$name"}>. @@ -2859,7 +2860,7 @@ Perl_get_av(pTHX_ const char *name, I32 flags) PERL_ARGS_ASSERT_GET_AV; - if (flags) + if (flags & ~SVf_UTF8) return GvAVn(gv); if (gv) return GvAV(gv); @@ -2874,7 +2875,8 @@ Perl_get_av(pTHX_ const char *name, I32 flags) Returns the HV of the specified Perl hash. C are passed to C. If C is set and the Perl variable does not exist then it will be created. If C is zero -and the variable does not exist then C is returned. +(ignoring C) and the variable does not exist then C is +returned. =cut */ @@ -2886,7 +2888,7 @@ Perl_get_hv(pTHX_ const char *name, I32 flags) PERL_ARGS_ASSERT_GET_HV; - if (flags) + if (flags & ~SVf_UTF8) return GvHVn(gv); if (gv) return GvHV(gv); -- cgit v1.2.1