#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.
Paths
| Differential D57891
[analyzer] Fix infinite recursion in printing macros ClosedPublic Authored by bruntib on Feb 7 2019, 7:09 AM.
Details Summary #define f(y) 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.
Diff Detail
Event TimelineComment Actions Is there a chance of obtaining a testcase for this? I would very strongly prefer one. This revision now requires changes to proceed.Feb 7 2019, 8:08 AM Comment Actions I added a test case for this recursive case. There is also a TODO in the code indicating the place where an additional fix will be required. Herald added subscribers: Charusso, jdoerfert, whisperity. · View Herald TranscriptMar 7 2019, 2:34 AM Comment Actions Well, yea, getting rid of a crash is great, it's kind of bummer that can't expand the macro properly in the testfile. I really fear that we need a far greater overhaul of this entire effort to support them properly -- which should be the task of another patch. Thanks! This revision is now accepted and ready to land.Mar 7 2019, 2:47 AM Closed by commit rL355705: [analyzer] Fix infinite recursion in printing macros (authored by Szelethus). · Explain WhyMar 8 2019, 8:25 AM This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 189670 lib/StaticAnalyzer/Core/PlistDiagnostics.cpp
test/Analysis/Inputs/expected-plists/plist-macros-with-expansion.cpp.plist
test/Analysis/plist-macros-with-expansion.cpp
|