]> granicus.if.org Git - clang/commit
[analyzer] Fix infinite recursion in printing macros
authorKristof Umann <dkszelethus@gmail.com>
Mon, 25 Feb 2019 18:49:42 +0000 (18:49 +0000)
committerKristof Umann <dkszelethus@gmail.com>
Mon, 25 Feb 2019 18:49:42 +0000 (18:49 +0000)
commit4fcf17584e33f879b3cf58fe163ca7c6574b8762
treeb4164dc3580de90f342af2c7d280377d8d1e1c2c
parent46ee6e0f9aa23aac11b45d4631f19d6fa0753893
[analyzer] Fix infinite recursion in printing macros

#define f(y) x
#define x f(x)
int main() { x; }

This example results a compilation error since "x" in the first line was not
defined earlier. However, the macro expression printer goes to an infinite
recursion on this example.

Patch by Tibor Brunner!

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354806 91177308-0d34-0410-b5e6-96231b3b80d8
lib/StaticAnalyzer/Core/PlistDiagnostics.cpp