[all-commits] [llvm/llvm-project] f3a4de: [libcxx][ios] initialize __fill_val_ in _FillHelpe...

David Tenty via All-commits all-commits at lists.llvm.org
Mon Sep 30 16:24:53 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: f3a4def436618c24e2eb9faa812994beb2cd7744
      https://github.com/llvm/llvm-project/commit/f3a4def436618c24e2eb9faa812994beb2cd7744
  Author: David Tenty <daltenty at ibm.com>
  Date:   2024-09-30 (Mon, 30 Sep 2024)

  Changed paths:
    M libcxx/include/ios

  Log Message:
  -----------
  [libcxx][ios] initialize __fill_val_ in _FillHelper (#110279)

This is a small fix to https://github.com/llvm/llvm-project/pull/89305.
In the `__init` function of `_FillHelper`, `__fill_val_` was left
uninitialized. This worked for the implementation in the PR because we
always checked `__set_` before trying to read it, and would initialize
if it was unset.

However it turns out in earlier versions of the header (at least on AIX
which followed this path), we do a read of `__fill_val_` even if
`__set_` was false before initializing, to check if it matched the
sentinel value, so this causes undesired behaviour and UB.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list