[all-commits] [llvm/llvm-project] 840edd: [analyzer] Don't escape local static memregions on...

Balazs Benics via All-commits all-commits at lists.llvm.org
Thu Jan 12 01:43:31 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 840edd8ab2620a52e9acbef7de037c9f465dfce7
      https://github.com/llvm/llvm-project/commit/840edd8ab2620a52e9acbef7de037c9f465dfce7
  Author: Balazs Benics <benicsbalazs at gmail.com>
  Date:   2023-01-12 (Thu, 12 Jan 2023)

  Changed paths:
    M clang/lib/StaticAnalyzer/Core/ExprEngine.cpp
    A clang/test/Analysis/malloc-static-storage.cpp

  Log Message:
  -----------
  [analyzer] Don't escape local static memregions on bind

When the engine processes a store to a variable, it will eventually call
`ExprEngine::processPointerEscapedOnBind()`. This function is supposed to
invalidate (put the given locations to an escape list) the locations
which we cannot reason about.

Unfortunately, local static variables are also put into this list.

This patch relaxes the guard condition, so that beyond stack variables,
static local variables are also ignored.

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




More information about the All-commits mailing list