This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
pp_negate: Support magic big ints as strings
authorFather Chrysostomos <sprout@cpan.org>
Thu, 7 Jun 2012 06:05:24 +0000 (23:05 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Thu, 7 Jun 2012 15:18:55 +0000 (08:18 -0700)
commit7dbe31506f4be3f410f64640daa16b8ad483d61f
treeeab3f9c6aeada3679a3fe304493c2ec929401332
parentd5aa71b8d668347b748a6c784882e3ca8c85e3c6
pp_negate: Support magic big ints as strings

-$1 was treating $1 as a float even if the string consisted of an
integer, due to incorrect flag checks.  It was doing the same things
with tied variables returning str+int dualvars.

Simply checking whether the privates flags consist solely of SVp_IOK
(which works for tie variables returning pure integers--so I wasn’t
entirely wrong in adding that logic a few commits ago), isn’t suffi-
cient. For gmagical variables that have already had get-magic called
on them, the private flags are equivalent to public flags for other
variables.
pp.c
t/op/negate.t