develooper Front page | perl.perl5.changes | Postings from April 2020

[Perl/perl5] f533d0: doop.c: Fix typo in comment; add comment

From:
Karl Williamson
Date:
April 1, 2020 16:26
Subject:
[Perl/perl5] f533d0: doop.c: Fix typo in comment; add comment
Message ID:
Perl/perl5/push/refs/heads/smoke-me/khw-tr/9c5471-0559fc@github.com
  Branch: refs/heads/smoke-me/khw-tr
  Home:   https://github.com/Perl/perl5
  Commit: f533d041ad9cba19df3cfbb2215daf225bf7d807
      https://github.com/Perl/perl5/commit/f533d041ad9cba19df3cfbb2215daf225bf7d807
  Author: Karl Williamson <khw@cpan.org>
  Date:   2020-04-01 (Wed, 01 Apr 2020)

  Changed paths:
    M doop.c

  Log Message:
  -----------
  doop.c: Fix typo in comment; add comment


  Commit: e35c7efd0aac34322122453d55fd11ecdfeaffca
      https://github.com/Perl/perl5/commit/e35c7efd0aac34322122453d55fd11ecdfeaffca
  Author: Karl Williamson <khw@cpan.org>
  Date:   2020-04-01 (Wed, 01 Apr 2020)

  Changed paths:
    M op.c
    M t/op/tr.t

  Log Message:
  -----------
  tr/abc/de/: Properly handle longer lhs in in-place calc

A tr/// can be done in-place if the target string doesn't contain a
character whose transliterated representation is longer than the
original.  Otherwise, writing the new value would destroy the next
character we need to read.

In general, we can't know if a particular string contains such a
character without keeping a list of the problematic characters, and
scanning it ahead of time for occurrences of those.  Instead, we
determine at compilation time if, for a given transliteration, if there
exists any possible target string that could have an overwriting
problem.  If none exist, we edit in place.  Otherwise, we first make a
copy.

Prior to this commit, the code failed to account for the case where the
rhs is shorter than the left, so that any unmatched lhs characters map
to the final rhs one.  The reason the code didn't consider this is that
I didn't think of this possibility when writing it.

This fixes #17654 and #17643


  Commit: 0e6f2996c6bb3652e6bb57550be62df591e923ea
      https://github.com/Perl/perl5/commit/0e6f2996c6bb3652e6bb57550be62df591e923ea
  Author: Karl Williamson <khw@cpan.org>
  Date:   2020-04-01 (Wed, 01 Apr 2020)

  Changed paths:
    M op.c

  Log Message:
  -----------
  op.c: Add, clarify comments


  Commit: 92c678141cc7dae22336a4453132cb9052dd809d
      https://github.com/Perl/perl5/commit/92c678141cc7dae22336a4453132cb9052dd809d
  Author: Karl Williamson <khw@cpan.org>
  Date:   2020-04-01 (Wed, 01 Apr 2020)

  Changed paths:
    M ebcdic_tables.h
    M op.c
    M regen/ebcdic.pl

  Log Message:
  -----------
  Fix tr/// determination of inplace editing for EBCDIC

I realized as a result of fixing GH #17654, that the code didn't
properly decide if a tr/// can be done in-place on EBCDIC platforms.
Our test suite passed, but if we had had valgrind, it would have shown
failuress.


  Commit: 0559fcb59384f2de056b3c4e5f15daa7b94e4b34
      https://github.com/Perl/perl5/commit/0559fcb59384f2de056b3c4e5f15daa7b94e4b34
  Author: Karl Williamson <khw@cpan.org>
  Date:   2020-04-01 (Wed, 01 Apr 2020)

  Changed paths:
    M doop.c

  Log Message:
  -----------
  XXX see if works


Compare: https://github.com/Perl/perl5/compare/9c5471a91bd7...0559fcb59384



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