r244416 - [modules] PR22534: Load files specified by -fmodule-file= eagerly. In particular, this avoids the need to re-parse module map files when using such a module.

Gábor Horváth via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 18 13:21:54 PDT 2015


Sorry, I sent the original message to the wrong list.

---------- Forwarded message ----------
From: Gábor Horváth <xazax.hun at gmail.com>
Date: 18 August 2015 at 12:59
Subject: Re: r244416 - [modules] PR22534: Load files specified by
-fmodule-file= eagerly. In particular, this avoids the need to re-parse
module map files when using such a module.
To: Richard Smith <richard at metafoo.co.uk>
Cc: "cfe-commits at cs.uiuc.edu" <cfe-commits at cs.uiuc.edu>


Hi!

In r244416 you made createModuleManager to call the Initialize method of
the ASTConsumer.
Because of this change the ASTConsumer::Initialize might be called twice in
some scenarios.

This change makes the Static Analyzer crash (use after free) in those
scenarios. I think most of the ASTConsumers was not written with that in
mind Initialize might be called twice for the object. This fact is also not
covered by the documentation.

In my opinion we should either guarantee that the Initialize method will be
called only once during the lifetime of an ASTConsumer, or document the
fact that, it might be called multiple times and notify the authors of the
different consumers to update their classes accordingly (announcement on
the mailing list?).

What do you think?

Regards,
Gabor Horvath
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150818/95a2f20d/attachment.html>


More information about the cfe-commits mailing list