This is an archive of the discontinued LLVM Phabricator instance.

DeferredDiagnosticsEmitter crashes
ClosedPublic

Authored by glevner on Oct 7 2020, 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.Oct 7 2020, 1:29 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 7 2020, 1:30 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
glevner requested review of this revision.Oct 7 2020, 1:30 AM
yaxunl added a comment.Oct 7 2020, 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.Oct 8 2020, 5:43 AM

LGTM. Thanks.

This revision is now accepted and ready to land.Oct 8 2020, 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.Oct 8 2020, 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.Oct 8 2020, 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.