This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Revert code change from #32148
authorRafael Garcia-Suarez <rgarciasuarez@gmail.com>
Sat, 20 Oct 2007 15:19:20 +0000 (15:19 +0000)
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>
Sat, 20 Oct 2007 15:19:20 +0000 (15:19 +0000)
p4raw-id: //depot/perl@32150

sv.c

diff --git a/sv.c b/sv.c
index 25f1441..233f5cb 100644 (file)
--- a/sv.c
+++ b/sv.c
@@ -2514,6 +2514,8 @@ access this function.
 SV *
 Perl_sv_2num(pTHX_ register SV *sv)
 {
+    if (!SvROK(sv))
+       return sv;
     if (SvAMAGIC(sv)) {
        SV * const tmpsv = AMG_CALLun(sv,numer);
        if (tmpsv && (!SvROK(tmpsv) || (SvRV(tmpsv) != SvRV(sv))))