From: rafl Date: Sun, 12 Oct 2008 14:27:04 +0000 (+0000) Subject: Make get_linestr_offset return -1 if we're not parsing. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=a3c94b5c6a4f6361dca45fa83e6b870577a9b1ed;p=p5sagit%2FDevel-Declare.git Make get_linestr_offset return -1 if we're not parsing. git-svn-id: http://dev.catalyst.perl.org/repos/bast/Devel-Declare/1.000/trunk@4917 bd8105ee-0ff8-0310-8827-fb3f25b6796d --- diff --git a/Declare.xs b/Declare.xs index 69dd632..7f383a8 100644 --- a/Declare.xs +++ b/Declare.xs @@ -139,7 +139,11 @@ char* dd_get_curstash_name(pTHX) { } int dd_get_linestr_offset(pTHX) { - char* linestr = SvPVX(PL_linestr); + char* linestr; + if (!DD_HAVE_PARSER) { + return -1; + } + linestr = SvPVX(PL_linestr); return PL_bufptr - linestr; }