Page MenuHomePhabricator

DeferredDiagnosticsEmitter crashes
ClosedPublic

Authored by glevner on Wed, Oct 7, 1:29 AM.

Details

Summary

Patch VisitCXXDeleteExpr() in clang::UsedDeclVisitor to avoid it crashing when the expression's destroyed type is null. According to the comments in CXXDeleteExpr::getDestroyedType(), this can happen when the type to delete is a dependent type.

Diff Detail

Event Timeline

glevner created this revision.Wed, Oct 7, 1:29 AM
Herald added a project: Restricted Project. · View Herald TranscriptWed, Oct 7, 1:30 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
glevner requested review of this revision.Wed, Oct 7, 1:30 AM
yaxunl added a comment.Wed, Oct 7, 4:38 AM

Can we have a lit test? Thanks.

I'm sorry, but I don't know how to reproduce the problem in isolation. We are JIT-compiling fairly complex C++ code, and the crash sometimes occurs when, for example, an included header file is not found...

yaxunl accepted this revision.Thu, Oct 8, 5:43 AM

LGTM. Thanks.

This revision is now accepted and ready to land.Thu, Oct 8, 5:43 AM

Great. I don't have commit access though. If I did, I would love to commit it to the release branch, which is what we use...

yaxunl added a subscriber: hans.Thu, Oct 8, 7:22 AM

I can help you commit it to trunk. For cherrypick to release branch, we may need help of @hans

hans added a comment.Thu, Oct 8, 8:06 AM

I can help you commit it to trunk. For cherrypick to release branch, we may need help of @hans

It's most likely too late for 11.0.0, but I will put it on my list of 11.0.1 candidates.

Good enough for us... Thanks, @hans and @yaxunl!

This revision was automatically updated to reflect the committed changes.