freebsd-src/contrib
Dimitry Andric ead8e4c081 Merge commit 382f70a877f0 from llvm-project (by Louis Dionne):
[libc++][NFC] Rewrite function call on two lines for clarity (#79141)

  Previously, there was a ternary conditional with a less-than comparison
  appearing inside a template argument, which was really confusing because
  of the <...> of the function template. This patch rewrites the same
  statement on two lines for clarity.

Merge commit d129ea8d2fa3 from llvm-project (by Vitaly Buka):

  [libcxx] Align `__recommend() + 1`  by __endian_factor (#90292)

  This is detected by asan after #83774

  Allocation size will be divided by `__endian_factor` before storing. If
  it's not aligned,
  we will not be able to recover allocation size to pass into
  `__alloc_traits::deallocate`.

  we have code like this
  ```
   auto __allocation = std::__allocate_at_least(__alloc(), __recommend(__sz) + 1);
      __p               = __allocation.ptr;
      __set_long_cap(__allocation.count);

  void __set_long_cap(size_type __s) _NOEXCEPT {
      __r_.first().__l.__cap_     = __s / __endian_factor;
      __r_.first().__l.__is_long_ = true;
    }

  size_type __get_long_cap() const _NOEXCEPT {
      return __r_.first().__l.__cap_ * __endian_factor;
    }

  inline ~basic_string() {
      __annotate_delete();
      if (__is_long())
        __alloc_traits::deallocate(__alloc(), __get_long_pointer(), __get_long_cap());
    }
  ```
  1. __recommend() -> even size
  2. `std::__allocate_at_least(__alloc(), __recommend(__sz) + 1)` - > not
  even size
  3. ` __set_long_cap() `- > lose one bit of size for __endian_factor == 2
  (see `/ __endian_factor`)
  4. `__alloc_traits::deallocate(__alloc(), __get_long_pointer(),
  __get_long_cap())` -> uses even size (see `__get_long_cap`)

This should fix incorrect deallocation sizes for some instances of
std::string. Memory profiling or debugging tools like AddressSanitizer,
LeakSanitizer or TCMalloc could then complain about the the size passed
to a deallocation not matching the size originally passed to the
allocation.

Reported by:	Aliaksei Kandratsenka <alkondratenko@gmail.com>
PR:		279560
MFC after:	3 days
2024-06-07 20:43:46 +02:00
..
arm-optimized-routines Update the Arm Optimized Routine library to v24.01 2024-02-29 11:39:12 +00:00
atf contrib: Remove various $FreeBSD$ tags not upstream 2024-05-31 13:49:17 -06:00
bc
bearssl
bionic-x86_64-string
blocklist
bmake Merge bmake-20240520 2024-05-23 13:12:43 -07:00
bsddialog contrib/bsddialog: Import version 1.0.3 2024-05-27 21:32:01 +02:00
bsnmp contrib: Remove various $FreeBSD$ tags not upstream 2024-05-31 13:49:17 -06:00
byacc
bzip2 contrib: Remove various $FreeBSD$ tags not upstream 2024-05-31 13:49:17 -06:00
capsicum-test
com_err
cortex-strings
dialog
diff contrib: Remove various $FreeBSD$ tags not upstream 2024-05-31 13:49:17 -06:00
dma
ee ee: Fix use of uninitialised pointer in ispell_op 2024-06-02 23:53:09 +01:00
elftoolchain Fix memory corruption in C++ demangler 2024-05-09 19:55:52 -06:00
expat contrib: Remove various $FreeBSD$ tags not upstream 2024-05-31 13:49:17 -06:00
file
flex
gdtoa
googletest
hyperv/tools
jemalloc contrib: Remove various $FreeBSD$ tags not upstream 2024-05-31 13:49:17 -06:00
kyua
ldns ldns: Ignore commented-out lines in resolv.conf. 2024-05-15 12:20:15 +02:00
ldns-host
less contrib: Remove various $FreeBSD$ tags not upstream 2024-05-31 13:49:17 -06:00
lib9p
libarchive libarchive: merge bugfixes from vendor branch 2024-04-30 11:55:01 +02:00
libbegemot
libc-pwcache
libc-vis
libcbor libcbor: vendor update to 0.11.0 2024-05-03 19:33:50 -04:00
libcxxrt contrib: Remove various $FreeBSD$ tags not upstream 2024-05-31 13:49:17 -06:00
libdiff libdiff: Detect and recover from file truncation. 2024-05-20 15:26:33 +02:00
libdivsufsort
libedit
libevent
libexecinfo
libfido2 libfido2: update to 1.14.0 2024-05-04 12:51:08 -04:00
libpcap
libucl libucl: import snapshot 2024-02-06 2024-02-29 13:27:03 +01:00
libxo
llvm-project Merge commit 382f70a877f0 from llvm-project (by Louis Dionne): 2024-06-07 20:43:46 +02:00
lua
lutok
mandoc cross-tools: fts has different types for cmp routine 2024-05-26 11:38:30 -06:00
mknod
mtree
ncurses contrib: Remove various $FreeBSD$ tags not upstream 2024-05-31 13:49:17 -06:00
netbsd-tests contrib: Remove various $FreeBSD$ tags not upstream 2024-05-31 13:49:17 -06:00
netcat contrib: Remove various $FreeBSD$ tags not upstream 2024-05-31 13:49:17 -06:00
ntp ntp: Vendor import of ntp-4.2.8p18 2024-05-26 18:41:22 -07:00
nvi
ofed ofed: don't expose symbols twice 2024-05-08 15:52:00 +01:00
one-true-awk awk: Merge in bsd-feature branch of OTA from 20240422 (31bb33a32f71) 2024-05-14 12:17:55 -06:00
openbsm contrib: Remove various $FreeBSD$ tags not upstream 2024-05-31 13:49:17 -06:00
opencsd/decoder
openpam
openresolv
pam_modules/pam_passwdqc
pf pf: convert DIOCNATLOOK to netlink 2024-06-04 14:59:58 +02:00
pjdfstest contrib: Remove various $FreeBSD$ tags not upstream 2024-05-31 13:49:17 -06:00
pnglite
pnpinfo
processor-trace
sendmail contrib: Remove various $FreeBSD$ tags not upstream 2024-05-31 13:49:17 -06:00
smbfs contrib: Remove various $FreeBSD$ tags not upstream 2024-05-31 13:49:17 -06:00
spleen
sqlite3 sqlite3: Vendor import of sqlite3 3.46.0 2024-06-02 19:28:53 -07:00
tcp_wrappers
tcpdump tcpdump: cope with incorrect packet lengths 2024-04-04 10:07:05 +02:00
tcsh contrib: Remove various $FreeBSD$ tags not upstream 2024-05-31 13:49:17 -06:00
telnet
terminus
tnftp
tzcode timezone: Move to the XSI/POSIX definition for timezone. 2024-03-11 22:19:31 -06:00
tzdata
unbound unbound: Vendor import 1.20.0 2024-05-10 14:23:43 -07:00
unifdef
unvis
vis
wireguard-tools
wpa wpa: Diff reduction with upstream 2024-05-31 10:02:37 -06:00
xz MFV: xz 5.6.2. 2024-06-03 18:14:43 -07:00