Branch: refs/heads/blead
  Home:   https://github.com/Perl/perl5
  Commit: 6802e2fd12df078747b8b07237b2b96ffcec6eff
      
https://github.com/Perl/perl5/commit/6802e2fd12df078747b8b07237b2b96ffcec6eff
  Author: Graham Knop <ha...@haarg.org>
  Date:   2022-04-12 (Tue, 12 Apr 2022)

  Changed paths:
    M sv.c
    M t/op/svflags.t

  Log Message:
  -----------
  fix SVf_POK getting set on NVs when copying

When copying an SV with SVp_POK set, the SVf_POK flag gets enabled on
the destination SV in all cases, to allow some of the COW logic to work
properly. The flag is then meant to be disabled later in the routine, if
the original SV was not SVp_POK. This was happening for IOK values, but
not NOK values. This would only impact a few values (Inf, -Inf, NaN) as
the string form of other floats is sensitive to locale so would not be
stored. In the past, values like this would also always have SVf_POK
set, but this has recently been changed to allow tracking the origin
type of a value, exposing this bug.

Fix this by checking for this case and unsetting the flag as
appropriate for SVf_NOK values, the same as was previously being done
for SVf_IOK values.


Reply via email to