[prev in list] [next in list] [prev in thread] [next in thread] 

List:       perl5-changes
Subject:    [Perl/perl5] b11187: ensure sv bodies are properly aligned
From:       Tony Cook <noreply () github ! com>
Date:       2020-03-29 20:30:23
Message-ID: Perl/perl5/push/refs/heads/blead/9cb930-b11187 () github ! com
[Download RAW message or body]

  Branch: refs/heads/blead
  Home:   https://github.com/Perl/perl5
  Commit: b11187bf165b7946337846701b6285b043e4aaa2
      https://github.com/Perl/perl5/commit/b11187bf165b7946337846701b6285b043e4aaa2
  Author: Tony Cook <tony@develop-help.com>
  Date:   2020-03-29 (Sun, 29 Mar 2020)

  Changed paths:
    M sv.c

  Log Message:
  -----------
  ensure sv bodies are properly aligned

In some cases SV bodies don't include the same members as lower sv type
bodies, in particular, PVMG includes an NV member, while PVCV and
other specialised bodies don't include it, so PVMG can have a larger
alignment boundary.

This can result in a PVCV having a smaller alignment boundary than
PVMG, resulting in potential undefined behaviour if a member that
is common between PVCV and PVMG is accessed on an lesser aligned
PVCV pointer.

To avoid that, ensure allocation sizes described in bodies_by_type[]
account for NV (and IV) alignment requirements.

fixes #17668
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic