[cfe-dev] [PATCH] TypeOfExpr serialization
Sebastian Redl
sebastian.redl at getdesigned.at
Wed Dec 24 04:13:55 PST 2008
Zhongxing Xu wrote:
>
>
> On Wed, Dec 24, 2008 at 2:11 PM, Ted Kremenek <kremenek at apple.com
> <mailto:kremenek at apple.com>> wrote:
>
> This looks right to me!
>
> On a separate issue, I'm mixed on having TypeOfExpr own the Expr
> (which I assume is the case right now). VLA types also own their
> size expressions, but I've never felt that Types should own
> expressions. This is a long-standing issue, however with the ASTs.
>
>
> Yeah. Having types own decls causes failure of
> serialization/deserialization on this code:
>
> struct s {
> };
>
> The struct is serialized twice: once by translation unit, the other by
> the type which owns it. When deserialized the second time,
> RegisterPtr() fails due to that the backpatch map already has final
> pointer.
If the Decl is owned twice, then it should also cause crashes on
shutdown, due to double deletion. Why does the type own the decl anyway?
Isn't the type produced by the ASTContext on request, from the decl? How
can it possibly own it?
Of course, types owning expressions is different from types owning decls.
Sebastian
More information about the cfe-dev
mailing list