[all-commits] [llvm/llvm-project] 809445: [StaticAnalyzer] Fix tryExpandAsInteger's failures...

Ziqing Luo via All-commits all-commits at lists.llvm.org
Thu Jun 5 02:28:39 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 8094454ea1cbe2530a06f44443e08f923ab9de40
      https://github.com/llvm/llvm-project/commit/8094454ea1cbe2530a06f44443e08f923ab9de40
  Author: Ziqing Luo <ziqing at udel.edu>
  Date:   2025-06-05 (Thu, 05 Jun 2025)

  Changed paths:
    M clang/lib/StaticAnalyzer/Core/CheckerHelpers.cpp
    R clang/test/Analysis/pch_crash.cpp
    A clang/test/Analysis/pch_macro.cpp

  Log Message:
  -----------
  [StaticAnalyzer] Fix tryExpandAsInteger's failures on PCH macros (#142722)

The function `tryExpandAsInteger` attempts to extract an integer from a
macro definition. Previously, the attempt would fail when the macro is
from a PCH, because the function tried to access the text buffer of the
source file, which does not exist in case of PCHs. The fix uses
`Preprocessor::getSpelling`, which works in either cases.

rdar://151403070

---------

Co-authored-by: Balazs Benics <benicsbalazs at gmail.com>



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