[all-commits] [llvm/llvm-project] 0a893c: [libc++] Avoid relying on non-portable behaviour i...

Alexander Richardson via All-commits all-commits at lists.llvm.org
Mon Oct 3 05:46:33 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 0a893cfb44e7d18296d6a7aff1ad11e615a89e93
      https://github.com/llvm/llvm-project/commit/0a893cfb44e7d18296d6a7aff1ad11e615a89e93
  Author: Alex Richardson <Alexander.Richardson at cl.cam.ac.uk>
  Date:   2022-10-03 (Mon, 03 Oct 2022)

  Changed paths:
    M libcxx/src/memory.cpp

  Log Message:
  -----------
  [libc++] Avoid relying on non-portable behaviour in std::align

Round-tripping pointers via size_t is not portable, the C/C++ standards
only require this to be valid when using (u)intptr_t.
Originally committed to the CHERI fork of LLVM as
https://github.com/CTSRD-CHERI/llvm-project/commit/dd01245185ab9e71b70b418bee8f11ea0199e1a3,
but I forgot to upstream the change. I rediscovered this issue due to a
compiler warning when building libc++ on a Arm Morello system.

Reviewed By: #libc, ldionne, philnik

Differential Revision: https://reviews.llvm.org/D134363




More information about the All-commits mailing list