[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)
commitcd8c438086b46b3edcf291cbfd52ca5e04382d53
treeec858b4bc16b9cb7978098c1b9935cbae341febe
parent310b75e51995e8a9aeae0ea6c6d7922324453f57
[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

llvm-svn: 354806
clang/lib/StaticAnalyzer/Core/PlistDiagnostics.cpp