newXS_len_flags() shouldn't change the line number on PL_curcop when warning.
authorNicholas Clark <nick@ccl4.org>
Mon, 13 Aug 2012 20:00:07 +0000 (22:00 +0200)
committerNicholas Clark <nick@ccl4.org>
Mon, 3 Sep 2012 10:55:23 +0000 (12:55 +0200)
commitd787f4a5ba95039e3f0b8f63ebc649cde1011c69
tree4eea0595afcf9fee48b3376ba903079dd9874d30
parent502e5101caadccb8d4d7ffd810c78d57c81a4cb7
newXS_len_flags() shouldn't change the line number on PL_curcop when warning.

This can actually generate incorrect line numbers in runtime warnings, when
XSUBs are redefined from calls made from BEGIN blocks, and the line number
from the opening brace of the begin block is mashed with the filename of the
current line. For compiletime warnings, PL_curcop == &PL_compiling, so the
line numbers will be correct whether taken from PL_compiling or PL_parser.

This code dates back to perl-5.000, when it was added to newXS(). It appears
to be a copy of code present in newSUB() since alpha 2.
op.c
t/lib/warnings/op