1 Commits

Author SHA1 Message Date
Ziqing Luo
8094454ea1
[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@gmail.com>
2025-06-05 11:28:16 +02:00