summaryrefslogtreecommitdiff
path: root/sv.c
diff options
context:
space:
mode:
authorHugo van der Sanden <hv@crypt.org>2002-11-04 15:49:29 +0000
committerhv <hv@crypt.org>2002-11-04 15:49:29 +0000
commitb4b9a3288b9178e46ae8397db4a9c2e17d729ebf (patch)
treea65d47cbaebd50204793f60374f2f8e5a112b0d3 /sv.c
parent51cf30b653436b0bbc2a8b902381f06f5842ab04 (diff)
downloadperl-b4b9a3288b9178e46ae8397db4a9c2e17d729ebf.tar.gz
extend #13786 to cover the other four identical chunks of code
to avoid looping under overload. p4raw-id: //depot/perl@18090
Diffstat (limited to 'sv.c')
-rw-r--r--sv.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sv.c b/sv.c
index 14dbc1e5b1..48efa2e6f3 100644
--- a/sv.c
+++ b/sv.c
@@ -2026,7 +2026,7 @@ Perl_sv_2iv(pTHX_ register SV *sv)
if (SvROK(sv)) {
SV* tmpstr;
if (SvAMAGIC(sv) && (tmpstr=AMG_CALLun(sv,numer)) &&
- (SvTYPE(tmpstr) != SVt_RV || (SvRV(tmpstr) != SvRV(sv))))
+ (!SvROK(tmpstr) || (SvRV(tmpstr) != SvRV(sv))))
return SvIV(tmpstr);
return PTR2IV(SvRV(sv));
}
@@ -2323,7 +2323,7 @@ Perl_sv_2uv(pTHX_ register SV *sv)
if (SvROK(sv)) {
SV* tmpstr;
if (SvAMAGIC(sv) && (tmpstr=AMG_CALLun(sv,numer)) &&
- (SvTYPE(tmpstr) != SVt_RV || (SvRV(tmpstr) != SvRV(sv))))
+ (!SvROK(tmpstr) || (SvRV(tmpstr) != SvRV(sv))))
return SvUV(tmpstr);
return PTR2UV(SvRV(sv));
}
@@ -2611,7 +2611,7 @@ Perl_sv_2nv(pTHX_ register SV *sv)
if (SvROK(sv)) {
SV* tmpstr;
if (SvAMAGIC(sv) && (tmpstr=AMG_CALLun(sv,numer)) &&
- (SvTYPE(tmpstr) != SVt_RV || (SvRV(tmpstr) != SvRV(sv))))
+ (!SvROK(tmpstr) || (SvRV(tmpstr) != SvRV(sv))))
return SvNV(tmpstr);
return PTR2NV(SvRV(sv));
}
@@ -2931,7 +2931,7 @@ Perl_sv_2pv_flags(pTHX_ register SV *sv, STRLEN *lp, I32 flags)
if (SvROK(sv)) {
SV* tmpstr;
if (SvAMAGIC(sv) && (tmpstr=AMG_CALLun(sv,string)) &&
- (SvTYPE(tmpstr) != SVt_RV || (SvRV(tmpstr) != SvRV(sv)))) {
+ (!SvROK(tmpstr) || (SvRV(tmpstr) != SvRV(sv)))) {
char *pv = SvPV(tmpstr, *lp);
if (SvUTF8(tmpstr))
SvUTF8_on(sv);