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

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

From:
John Paul Adrian Glaubitz
Date:
June 19, 2020 22:14
Subject:
[Perl/perl5] 1d07de: op.h: Add additional padding to struct opslabto e...
Message ID:
Perl/perl5/push/refs/heads/smoke-me/jkeenan/ghpr-17875/000000-1d07de@github.com
  Branch: refs/heads/smoke-me/jkeenan/ghpr-17875
  Home:   https://github.com/Perl/perl5
  Commit: 1d07debdf6b45c960378173f7278727fa8154c60
      https://github.com/Perl/perl5/commit/1d07debdf6b45c960378173f7278727fa8154c60
  Author: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
  Date:   2020-06-19 (Fri, 19 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