[all-commits] [llvm/llvm-project] 4233a1: [FunctionAttrs] Handle zero writes in initializes ...

Florian Hahn via All-commits all-commits at lists.llvm.org
Sat Jan 18 12:01:45 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 4233a15c9f8e6f77a00a5770a35b70ab8a2705c6
      https://github.com/llvm/llvm-project/commit/4233a15c9f8e6f77a00a5770a35b70ab8a2705c6
  Author: Florian Hahn <flo at fhahn.com>
  Date:   2025-01-18 (Sat, 18 Jan 2025)

  Changed paths:
    M llvm/lib/Transforms/IPO/FunctionAttrs.cpp
    M llvm/test/Transforms/FunctionAttrs/initializes.ll

  Log Message:
  -----------
  [FunctionAttrs] Handle zero writes in initializes inference.

ConstantRange's constructor asserts that the range not empty, except if
lower/upper are min or max values.

Check if the length is strictly positive instead of just non-negative so
std::nullopt is returned when the size is 0. If that's the case, the
access doesn't initialize anything.

This should fix a crash when building on macOS with ASan & UBsan after
https://github.com/llvm/llvm-project/pull/97373 /
https://github.com/llvm/llvm-project/pull/117104 landed:
https://green.lab.llvm.org/job/llvm.org/job/clang-stage2-cmake-RgSan/664/console



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