Forbid ++ and -- on readonly values
Subject: You can ++ and -- readonly integer scalars? (patch included)
I managed to find an illustration of the bug in a perl one-liner:
perl -e '*a = \100; $a++; print "$a\n"'
101
Perhaps that's been fixed in one of the beta releases which I'm not
running; or perhaps I'm the only one who finds that slightly incorrect.
If so, ignore the rest of this message.
You can modify readonly scalars using any of the pre/post
increment/decrement operators. Apparently, the only readonly checking is
done for cases like '100++'.
I managed to find the relevant code and add some SvREADONLY checks. It
now dies on the inc/dec of readonly scalars with the appropriate nasty
message. I just thought I'd share my patch.
Ashley Winters
p5p-msgid: <Pine.LNX.3.95.
970110193330.11249D-100000@jql.accessone.com>