avoid bogus line number in XSUB redefined warnings
authorGurusamy Sarathy <gsar@cpan.org>
Sun, 25 Oct 1998 07:07:29 +0000 (07:07 +0000)
committerGurusamy Sarathy <gsar@cpan.org>
Sun, 25 Oct 1998 07:07:29 +0000 (07:07 +0000)
p4raw-id: //depot/perl@2070

op.c

diff --git a/op.c b/op.c
index 6e2cc64..4af15e7 100644 (file)
--- a/op.c
+++ b/op.c
@@ -4037,7 +4037,8 @@ newXS(char *name, void (*subaddr) (CV * _CPERLproto), char *filename)
                            && HvNAME(GvSTASH(CvGV(cv)))
                            && strEQ(HvNAME(GvSTASH(CvGV(cv))), "autouse"))) {
                line_t oldline = PL_curcop->cop_line;
-               PL_curcop->cop_line = PL_copline;
+               if (PL_copline != NOLINE)
+                   PL_curcop->cop_line = PL_copline;
                warner(WARN_REDEFINE, "Subroutine %s redefined",name);
                PL_curcop->cop_line = oldline;
            }