This is an archive of the discontinued LLVM Phabricator instance.

Avoid accessing an invalid PresumedLoc
ClosedPublic

Authored by jordan_rose on Jun 7 2016, 5:48 PM.

Details

Reviewers
rsmith
Summary

DiagnosticNoteRenderer asserts trying to emit its "while building module Foo imported from bar.h:5" note when the presumed location of the import is invalid. This assertion was added in r267914, where most uses of getFilename were updated to test isValid instead.

I can't come up with a test because this location is always valid in C-based code, but external clients that manually import modules (*cough*Swift*cough*) sometimes provide invalid SourceLocations.

rdar://problem/26099576

Diff Detail

Repository
rL LLVM

Event Timeline

jordan_rose updated this revision to Diff 59979.Jun 7 2016, 5:48 PM
jordan_rose retitled this revision from to Avoid accessing an invalid PresumedLoc.
jordan_rose updated this object.
jordan_rose added a reviewer: rsmith.
jordan_rose set the repository for this revision to rL LLVM.
jordan_rose updated this object.
jordan_rose added a subscriber: cfe-commits.

*ping*

I'm happy to have someone else review this (or "LGTM" this), but it's so small that I'm not sure who else to ask. I'd rather not just commit it cause it's been a while since I've touched Clang.

rsmith accepted this revision.Jun 27 2016, 12:57 PM
rsmith edited edge metadata.
This revision is now accepted and ready to land.Jun 27 2016, 12:57 PM
jordan_rose closed this revision.Jun 27 2016, 6:09 PM

Committed as r273976.