summaryrefslogtreecommitdiff
path: root/pp.c
diff options
context:
space:
mode:
authorYitzchak Scott-Thoennes <sthoenna@efn.org>2003-05-07 08:27:07 -0700
committerJarkko Hietaniemi <jhi@iki.fi>2003-05-08 18:12:46 +0000
commit126c71c82576d5dc652db25ca9e3f8e18442c4fd (patch)
treee2790a78faaa94be96e8fcce8035cddddae1602e /pp.c
parent86e5a81e88dbe10bf1c195d6ca6fefab8bfafc17 (diff)
downloadperl-126c71c82576d5dc652db25ca9e3f8e18442c4fd.tar.gz
Re: [perl #17718] %tiedhash in bool context doesn't check if hash is empty
Message-ID: <7gYu+gzkgaFU092yn@efn.org> p4raw-id: //depot/perl@19452
Diffstat (limited to 'pp.c')
-rw-r--r--pp.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/pp.c b/pp.c
index 53aea9b835..7acc1da8da 100644
--- a/pp.c
+++ b/pp.c
@@ -107,6 +107,9 @@ PP(pp_padhv)
}
else if (gimme == G_SCALAR) {
SV* sv = sv_newmortal();
+ if (SvRMAGICAL(TARG) && mg_find(TARG, PERL_MAGIC_tied))
+ Perl_croak(aTHX_ "Can't provide tied hash usage; "
+ "use keys(%%hash) to test if empty");
if (HvFILL((HV*)TARG))
Perl_sv_setpvf(aTHX_ sv, "%ld/%ld",
(long)HvFILL((HV*)TARG), (long)HvMAX((HV*)TARG) + 1);