Fix parser buffer corruption with multiline *{...}
Since commit
a49b10d0a, it has been possible for scan_ident in toke.c
to reallocate the parser’s buffer (SvPVX(PL_linestr)) when scanning
for multiline whitespace.
For the sake of those cases where it finds an arbitrary expression,
not just an identifier, it records a pointer to the first opening
brace, which it returns to the parser after finding out that there is
indeed an expression.
That pointer was not being updated when the buffer was being
allocated.
The solution is to record an offset, rather than a pointer, of the
opening brace relative to the beginning of the current line of input.
This one-liner:
$ ./miniperl -e '*{' -e ' XS::APItest::gv_fetchmeth_type()' -e '}'
was giving me:
Unrecognized character \x80; marked by <-- HERE after 2<-- HERE near column 24 at -e line 2.
(There were nine nulls before the 2, but git stripped them out.)