This is an archive of the discontinued LLVM Phabricator instance.

[CFG] Fix crash on CFG building when deriving from a template.
ClosedPublic

Authored by courbet on Mar 10 2022, 2:33 AM.

Diff Detail

Event Timeline

courbet created this revision.Mar 10 2022, 2:33 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 10 2022, 2:33 AM
courbet requested review of this revision.Mar 10 2022, 2:33 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 10 2022, 2:33 AM
NoQ accepted this revision.Aug 12 2022, 2:06 PM

Hi, interesting, the code looks great but at a glance I don't see why would you even want a CFG for an uninstantiated template. Every time you want to analyze the actual runtime behavior of a program, you'll have a fully instantiated template AST to build the CFG from.

This revision is now accepted and ready to land.Aug 12 2022, 2:06 PM

Thanks !

Hi, interesting, the code looks great but at a glance I don't see why would you even want a CFG for an uninstantiated template. Every time you want to analyze the actual runtime behavior of a program, you'll have a fully instantiated template AST to build the CFG from.

I'm hitting this for an analysis that is eagerly analyzing templates before instantiation, and does not require the base classes. It's always better to not crash anyway :)