[PATCH] D44536: Avoid segfault when destructor is not yet known

2020-08-03 Thread John McCall via Phabricator via cfe-commits
rjmccall added a comment. Would you like to pick it back up? We laid out an implementation path: we need to track the fact that a delete was of an incomplete class type in the AST and then unconditionally treat such operations as trivial to destroy in IRGen. Repository: rC Clang CHANGES

[PATCH] D44536: Avoid segfault when destructor is not yet known

2020-08-02 Thread Dimitry Andric via Phabricator via cfe-commits
dim added a comment. Hm, this review's still open after two years, and even as of 2020-08-02 clang still crashes on the sample. :) Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D44536/new/ https://reviews.llvm.org/D44536

[PATCH] D44536: Avoid segfault when destructor is not yet known

2018-04-02 Thread John McCall via Phabricator via cfe-commits
rjmccall added a comment. In https://reviews.llvm.org/D44536#1054929, @rsmith wrote: > It seems that we have two options: either we valiantly try to support this: > > - we keep a list of types for which we've tried to form a > //delete-expression//, but found that the type was incomplete > -

[PATCH] D44536: Avoid segfault when destructor is not yet known

2018-04-02 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
rsmith added a comment. In https://reviews.llvm.org/D44536#1051232, @rjmccall wrote: > Right. Again, I'd like Richard to weigh in here, but my suspicion would be > that, somehow, the fact that e is an incomplete type when we type-check that > call is combining poorly with the fact that it's

[PATCH] D44536: Avoid segfault when destructor is not yet known

2018-04-02 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
rsmith added a comment. It seems that we have two options: either we valiantly try to support this: - we keep a list of types for which we've tried to form a //delete-expression//, but found that the type was incomplete - when such a type is completed, we mark the destructor as used, triggering

[PATCH] D44536: Avoid segfault when destructor is not yet known

2018-03-28 Thread John McCall via Phabricator via cfe-commits
rjmccall added a comment. In https://reviews.llvm.org/D44536#1051181, @ahatanak wrote: > I see, so Sema::CheckCompletedCXXClass probably isn't the right place to call > DeclareImplicitDestructor as that could significantly increase the size of > the AST. Right. Again, I'd like Richard to

[PATCH] D44536: Avoid segfault when destructor is not yet known

2018-03-28 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. I see, so Sema::CheckCompletedCXXClass probably isn't the right place to call DeclareImplicitDestructor as that could significantly increase the size of the AST. Repository: rC Clang https://reviews.llvm.org/D44536

[PATCH] D44536: Avoid segfault when destructor is not yet known

2018-03-28 Thread John McCall via Phabricator via cfe-commits
rjmccall added a comment. I think it's part of an effort to avoid creating implicit declarations for all the special members of every struct we parse from system headers. Repository: rC Clang https://reviews.llvm.org/D44536 ___ cfe-commits

[PATCH] D44536: Avoid segfault when destructor is not yet known

2018-03-28 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. In https://reviews.llvm.org/D44536#1039428, @rjmccall wrote: > Hmm. Sema is lazy about actually creating implicit destructor declarations, > but it's supposed to only do it whenever the destructor is actually used for > something. I'm looking at a similar problem

[PATCH] D44536: Avoid segfault when destructor is not yet known

2018-03-28 Thread Dimitry Andric via Phabricator via cfe-commits
dim added a comment. Ping. Open to sugggestions here :) Repository: rC Clang https://reviews.llvm.org/D44536 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D44536: Avoid segfault when destructor is not yet known

2018-03-19 Thread John McCall via Phabricator via cfe-commits
rjmccall added a comment. I think Richard is probably catching up from a week at the C++ committee. To be clear, I am objecting to this; I think the destructor should clearly have been created at this point. I'm just hoping Richard will have an idea for how best to fix it. Repository: rC

[PATCH] D44536: Avoid segfault when destructor is not yet known

2018-03-19 Thread Dimitry Andric via Phabricator via cfe-commits
dim added a comment. @rsmith, any objections? Repository: rC Clang https://reviews.llvm.org/D44536 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D44536: Avoid segfault when destructor is not yet known

2018-03-15 Thread John McCall via Phabricator via cfe-commits
rjmccall added a comment. In https://reviews.llvm.org/D44536#1039428, @rjmccall wrote: > Hmm. Sema is lazy about actually creating implicit destructor declarations, > but it's supposed to only do it whenever the destructor is actually used for > something. I suspect that Sema just thinks

[PATCH] D44536: Avoid segfault when destructor is not yet known

2018-03-15 Thread John McCall via Phabricator via cfe-commits
rjmccall added a comment. Hmm. Sema is lazy about actually creating implicit destructor declarations, but it's supposed to only do it whenever the destructor is actually used for something. I suspect that Sema just thinks that nothing is using c::~c, because the only thing that does use it

[PATCH] D44536: Avoid segfault when destructor is not yet known

2018-03-15 Thread Dimitry Andric via Phabricator via cfe-commits
dim added a comment. In https://reviews.llvm.org/D44536#1039420, @rjmccall wrote: > I'm not sure it's supposed to be a valid state to get into IRGen with a > non-trivial destructor that isn't yet declared. Richard? As a side note, clang also emits a warning about it (but then crashes :) ):

[PATCH] D44536: Avoid segfault when destructor is not yet known

2018-03-15 Thread John McCall via Phabricator via cfe-commits
rjmccall added a comment. I'm not sure it's supposed to be a valid state to get into IRGen with a non-trivial destructor that isn't yet declared. Richard? Repository: rC Clang https://reviews.llvm.org/D44536 ___ cfe-commits mailing list

[PATCH] D44536: Avoid segfault when destructor is not yet known

2018-03-15 Thread Dimitry Andric via Phabricator via cfe-commits
dim created this revision. dim added reviewers: rjmccall, rsmith, majnemer, efriedma. In some cases, a class type can have a definition, but its destructor may not yet be known. In that case, a segfault can occur in `EmitObjectDelete`. Avoid it by checking the return value of