X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=p5sagit%2FDevel-Declare.git;a=blobdiff_plain;f=Declare.xs;h=41a991b929212c9cd0f85243308978bb159c3377;hp=be70d82b7b607b73b8bcdb63621534ad20170b16;hb=d3480bb491db24c6775fdb73de579f9e797c7d3b;hpb=5cce7a82860de23a23bcc21111f17ca50ecc0787 diff --git a/Declare.xs b/Declare.xs index be70d82..41a991b 100644 --- a/Declare.xs +++ b/Declare.xs @@ -218,10 +218,14 @@ int dd_toke_scan_ident(pTHX_ int offset) { } int dd_toke_scan_str(pTHX_ int offset) { + char* old_pvx = SvPVX(PL_linestr); STRLEN remaining = sv_len(PL_linestr) - offset; SV* line_copy = newSVsv(PL_linestr); char* base_s = SvPVX(PL_linestr) + offset; char* s = scan_str(base_s, FALSE, FALSE); + if(SvPVX(PL_linestr) != old_pvx) + croak("PL_linestr reallocated during scan_str, " + "Devel::Declare can't continue"); if (s != base_s && sv_len(PL_lex_stuff) > remaining) { int ret = (s - SvPVX(PL_linestr)) + remaining; sv_catsv(line_copy, PL_linestr);