[PATCH] D61707: [Preprocessor] Fix crash emitting note with framework location for "file not found" error.

Volodymyr Sapsai via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed May 8 17:41:29 PDT 2019


vsapsai created this revision.
vsapsai added reviewers: arphaman, erik.pilkington, jkorous.
Herald added a subscriber: dexonsmith.

A filename can be remapped with a header map to point to a framework
header and we can find the corresponding framework without the header.
But if the original filename doesn't have a remapped framework name,
we'll fail to find its location and will dereference a null pointer
during diagnostics emission.

Fix by tracking remappings better and emit the note only if a framework
is found before any of the remappings.

rdar://problem/48883447


https://reviews.llvm.org/D61707

Files:
  clang/include/clang/Lex/HeaderSearch.h
  clang/lib/Lex/HeaderSearch.cpp
  clang/test/Preprocessor/Inputs/include-header-missing-in-framework/TestFramework.hmap.json
  clang/test/Preprocessor/include-header-missing-in-framework-with-headermap.c

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D61707.198747.patch
Type: text/x-patch
Size: 4769 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190509/ab300786/attachment.bin>


More information about the cfe-commits mailing list