This is an archive of the discontinued LLVM Phabricator instance.

[libclang] Fix error handler in translateSourceLocation.
ClosedPublic

Authored by simon_tatham on Jun 17 2021, 1:24 AM.

Details

Summary

Given an invalid SourceLocation, translateSourceLocation will call
clang_getNullLocation, and then do nothing with the result. But
clang_getNullLocation has no side effects: it just constructs and
returns a null CXSourceLocation value.

Surely the intention was to return that null CXSourceLocation to
the caller, instead of throwing it away and pressing on anyway.

Diff Detail

Event Timeline

simon_tatham requested review of this revision.Jun 17 2021, 1:24 AM
simon_tatham created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptJun 17 2021, 1:24 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
miyuki accepted this revision.Jun 18 2021, 4:20 AM
miyuki added a subscriber: miyuki.

This change is pretty obvious. LGTM.

This revision is now accepted and ready to land.Jun 18 2021, 4:20 AM