toke.c:yylex: assert that PL_linestr is not a COW
authorFather Chrysostomos <sprout@cpan.org>
Wed, 17 Jul 2013 06:29:25 +0000 (23:29 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Fri, 19 Jul 2013 17:11:00 +0000 (10:11 -0700)
commit2cc6fe62efccaf47e15982ddbe988a976469d887
tree27b2b4fef3126378e3295ebb32ab0a7f6ccf75b2
parent217f6fa330a187be32a68556507e3165b8747f55
toke.c:yylex: assert that PL_linestr is not a COW

and fix the one bug this uncovers.

With COW enabled all the time, it is easy to introduce bugs like this.
See also 4e917a04.  In short, toke.c expects to be able to modify
PL_linestr’s buffer.  Putting this assertion in yylex (a hot path)
will make sure PL_linestr never becomes a COW again.
toke.c