develooper Front page | perl.perl5.changes | Postings from August 2022

[Perl/perl5] c47242: Define the remaining convenience cMETHOP*macros

From:
Paul Evans via perl5-changes
Date:
August 3, 2022 08:52
Subject:
[Perl/perl5] c47242: Define the remaining convenience cMETHOP*macros
Message ID:
Perl/perl5/push/refs/heads/blead/fab1ab-4dd482@github.com
  Branch: refs/heads/blead
  Home:   https://github.com/Perl/perl5
  Commit: c47242c255ce659acb89a8d155b93d611ea787bc
      https://github.com/Perl/perl5/commit/c47242c255ce659acb89a8d155b93d611ea787bc
  Author: Paul "LeoNerd" Evans <leonerd@leonerd.org.uk>
  Date:   2022-08-03 (Wed, 03 Aug 2022)

  Changed paths:
    M dump.c
    M ext/B/B.xs
    M op.c
    M op.h
    M peep.c
    M pp_hot.c

  Log Message:
  -----------
  Define the remaining convenience cMETHOP* macros

Several of these were missing:
  cMETHOP, cMETHOPo, kMETHOP

Also, the field-accessing ones:
  cMETHOP_meth cMETHOP_rclass cMETHOPo_meth cMETHOPo_rclass

This commit adds them all, and use them to neaten other code where
appropriate.


  Commit: c049a0a1b50a03f5acfccd6cb14c268a8168418b
      https://github.com/Perl/perl5/commit/c049a0a1b50a03f5acfccd6cb14c268a8168418b
  Author: Paul "LeoNerd" Evans <leonerd@leonerd.org.uk>
  Date:   2022-08-03 (Wed, 03 Aug 2022)

  Changed paths:
    M op.h

  Log Message:
  -----------
  Create a dedicated cMETHOPx_meth() macro

Don't just reuse the cSVOPx_sv() one any more, so we no longer have to
keep the same storage shape for SVOPs vs METHOPs.


  Commit: 4b0ceb86a69dee7c4031370d54c78b64f3c3ee06
      https://github.com/Perl/perl5/commit/4b0ceb86a69dee7c4031370d54c78b64f3c3ee06
  Author: Paul "LeoNerd" Evans <leonerd@leonerd.org.uk>
  Date:   2022-08-03 (Wed, 03 Aug 2022)

  Changed paths:
    M pp_hot.c

  Log Message:
  -----------
  assert() in pp_gv and pp_gvsv that the GV really is a GV

Or, in pp_gv it's also allowed to be a reference to a CV


  Commit: 4dd48237e57323de056710e155ba3be1fd67c65f
      https://github.com/Perl/perl5/commit/4dd48237e57323de056710e155ba3be1fd67c65f
  Author: Paul "LeoNerd" Evans <leonerd@leonerd.org.uk>
  Date:   2022-08-03 (Wed, 03 Aug 2022)

  Changed paths:
    M op.c
    M toke.c

  Log Message:
  -----------
  OP_RUNCV should be created by newSVOP()

This is in case rpeep converts it into an OP_CONST; it will need the
space big enough to be a full SVOP.

Before this commit it called `newPVOP()` which wasn't technically
correct, but since sizeof(PVOP) == sizeof(SVOP) nothing actually broke
when the memory slab was reused. However if the definition of either op
type is changed so this is no longer the case, it may cause otherwise
hard-to-debug memory corruption.


Compare: https://github.com/Perl/perl5/compare/fab1abc517d5...4dd48237e573



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