Branch: refs/heads/blead
  Home:   https://github.com/Perl/perl5
  Commit: df1adf37680de9507dfbd9644011fb2cf8d3eb53
      
https://github.com/Perl/perl5/commit/df1adf37680de9507dfbd9644011fb2cf8d3eb53
  Author: Lukas Mai <lukasmai....@gmail.com>
  Date:   2024-08-06 (Tue, 06 Aug 2024)

  Changed paths:
    M doio.c

  Log Message:
  -----------
  do_open6: delete unreachable code


  Commit: 471c834070f1d22c4f2dc1c9997a5adfd959f3e5
      
https://github.com/Perl/perl5/commit/471c834070f1d22c4f2dc1c9997a5adfd959f3e5
  Author: Lukas Mai <lukasmai....@gmail.com>
  Date:   2024-08-06 (Tue, 06 Aug 2024)

  Changed paths:
    M doio.c
    M op.c
    M op.h
    M t/io/perlio_open.t

  Log Message:
  -----------
  open: only treat literal undef as special

Passing undef as the filename to open should create a temporary file.
Previously, this was implemented as a simple `if (arg == &PL_sv_undef)`
check. However, other operations (such as accessing non-existent
array/hash elements) also return `&PL_sv_undef` directly, which `open`
would then silently interpret as directions to create a temp file.

Solution: Check (at compile time) whether the filename argument is an
`OP_UNDEF`, and if so, set the `OPf_SPECIAL` flag on `OP_OPEN`. At
runtime, if `&PL_sv_undef` is passed but `OPf_SPECIAL` is not set,
replace it by a new mortal SV, which is treated as a regular filename
(that happens to be undef) by PerlIO.

(For runtime calls via `&CORE::open`, we cannot distinguish between
`undef` and `delete $hash{nosuchkey}` as arguments, so to keep the
`undef` case working, we always set `OPf_SPECIAL` in the generated core
sub for `open`.)

This functionality probably should be a private op flag (something like
`OPpUNDEF_MEANS_TEMPFILE`?), but as far as I can tell, all possible
private bits are already taken in `OP_OPEN`.

Fixes #22385.


  Commit: bc9977150c2292e83f181383a5f7c455813b89b3
      
https://github.com/Perl/perl5/commit/bc9977150c2292e83f181383a5f7c455813b89b3
  Author: Lukas Mai <lukasmai....@gmail.com>
  Date:   2024-08-06 (Tue, 06 Aug 2024)

  Changed paths:
    M pod/perldelta.pod

  Log Message:
  -----------
  perldelta for #22385


Compare: https://github.com/Perl/perl5/compare/6532840837ae...bc9977150c22

To unsubscribe from these emails, change your notification settings at 
https://github.com/Perl/perl5/settings/notifications

Reply via email to