This is an archive of the discontinued LLVM Phabricator instance.

[Sema] PR25181 Fix crash when method declaration with throw spec fails to parse correctly
ClosedPublic

Authored by hintonda on Feb 10 2016, 7:08 AM.

Diff Detail

Repository
rL LLVM

Event Timeline

hintonda updated this revision to Diff 47449.Feb 10 2016, 7:08 AM
hintonda retitled this revision from to Return immediatedly if Method is null, otherwise you'll get a crash when dyn_cast is called with a nullptr.
hintonda updated this object.
hintonda added reviewers: doug.gregor, rnk.
hintonda added a subscriber: cfe-commits.

This needs a testcase added to the tests directory.

hintonda updated this revision to Diff 47456.Feb 10 2016, 8:00 AM
  • Reformatted change with clang-format
hintonda updated this revision to Diff 47501.Feb 10 2016, 11:53 AM
  • Added test for PR25181

I don't have commit access, so if this patch is accepted, could someone please commit it for me?

hintonda updated this revision to Diff 47923.Feb 13 2016, 7:09 PM
  • Only call HandleMemberFunctionDeclDelays() for valid NamedDecl pointers.

    HandleMemberFunctionDeclDelays() adds LateParsedMethodDeclaration elements to LateParsedDeclarations if the method has default args or exception-specifications. If null Methods are added, they will assert when cast in ParseLexedMethodDeclaration().
hintonda retitled this revision from Return immediatedly if Method is null, otherwise you'll get a crash when dyn_cast is called with a nullptr to [Sema] PR25181 Fix crash when method declaration with throw spec fails to parse correctly .Feb 13 2016, 7:13 PM
rnk accepted this revision.Feb 18 2016, 5:05 PM
rnk edited edge metadata.

Looks good, thanks. I like the new approach of avoiding the creation of a LateParsedMethodDeclaration if we couldn't get a NamedDecl back. I'll land it soon.

This revision is now accepted and ready to land.Feb 18 2016, 5:05 PM
This revision was automatically updated to reflect the committed changes.