develooper Front page | perl.perl5.changes | Postings from September 2021

[Perl/perl5] adeb72: gh19010: fix returns for Perl_grok_infnan

From:
Hugo van der Sanden via perl5-changes
Date:
September 17, 2021 12:52
Subject:
[Perl/perl5] adeb72: gh19010: fix returns for Perl_grok_infnan
Message ID:
Perl/perl5/push/refs/heads/hv/gh19010/a9475d-adeb72@github.com
  Branch: refs/heads/hv/gh19010
  Home:   https://github.com/Perl/perl5
  Commit: adeb727a4f245360db73194de368ebe30ec748a5
      https://github.com/Perl/perl5/commit/adeb727a4f245360db73194de368ebe30ec748a5
  Author: Hugo van der Sanden <hv@crypt.org>
  Date:   2021-09-17 (Fri, 17 Sep 2021)

  Changed paths:
    M ext/XS-APItest/t/grok.t
    M numeric.c

  Log Message:
  -----------
  gh19010: fix returns for Perl_grok_infnan

Consistently honour what the docs have always promised:
  If an infinity or a not-a-number is recognized, C<*sp> will point to
  one byte past the end of the recognized string.  If the recognition fails,
  zero is returned, and C<*sp> will not move.

Additionally, restore Perl_grok_number_flags to allowing inf/nan with
trailing garbage only when called with PERL_SCAN_TRAILING; add notes
to the other two core callers to clarify that they always accept such
trailing garbage.

A small number of XS-APItest tests were modified to reflect the stricter
behaviour: "Infin" and "nanx" are now invalid without PERL_SCAN_TRAILING.





nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About