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

[Perl/perl5] a76046: op.h: Add additional padding to struct opslabto e...

From:
John Paul Adrian Glaubitz
Date:
June 20, 2020 13:36
Subject:
[Perl/perl5] a76046: op.h: Add additional padding to struct opslabto e...
Message ID:
Perl/perl5/push/refs/heads/blead/727c47-a76046@github.com
  Branch: refs/heads/blead
  Home:   https://github.com/Perl/perl5
  Commit: a760468c9355bafaee57e94f13705c0ea925d9ca
      https://github.com/Perl/perl5/commit/a760468c9355bafaee57e94f13705c0ea925d9ca
  Author: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
  Date:   2020-06-20 (Sat, 20 Jun 2020)

  Changed paths:
    M AUTHORS
    M op.h

  Log Message:
  -----------
  op.h: Add additional padding to struct opslab to ensure proper alignment

On m68k, the natural alignment is 16 bits which causes the opslab_opslot
member of struct opslab to be aligned at a 16-bit offset. Other 32-bit
and 64-bit architectures have a natural alignment of at least 32 bits, so
the offset is always guaranteed to be at least 32-bit-aligned.

Fix this by adding additional padding bytes before the opslab_opslot
member, both for cases when PERL_DEBUG_READONLY_OPS defined and not
defined to ensure the offset of oplab_slots is always 32-bit-aligned.
On architectures which have a natural alignment of at least 32 bits,
the padding does not affect the alignment, offsets or struct size.



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