<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Jun 25, 2015, at 11:54, Justin Bogner <<a href="mailto:mail@justinbogner.com" class="">mail@justinbogner.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">Jordan Rose <<a href="mailto:jordan_rose@apple.com" class="">jordan_rose@apple.com</a>> writes:<br class=""><blockquote type="cite" class="">Author: jrose<br class="">Date: Wed Jun 24 14:27:02 2015<br class="">New Revision: 240571<br class=""><br class="">URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject-3Frev-3D240571-26view-3Drev&d=AwMFAg&c=8hUWFZcy2Z-Za5rBPlktOQ&r=BSqEv9KvKMW_Ob8SyngJ70KdZISM_ASROnREeq0cCxk&m=X1KDieomL1ontHeq2eddAQ13rm6frleEed-wgaa2ybk&s=RDw_I4kAWIITnRj9lBCv48K-GEckIsnySIeNKsES7SA&e=" class="">http://llvm.org/viewvc/llvm-project?rev=240571&view=rev</a><br class="">Log:<br class="">[Preprocessor] Iterating over all macros should include those from modules.<br class=""><br class="">So, iterate over the list of macros mentioned in modules, and make sure those<br class="">are in the master table.<br class=""></blockquote><br class="">This introduces a null dereference in Preprocessor::findDirectiveAtLoc.<br class="">It triggers in clang/test/Modules/crashes.m, so you can find it by<br class="">adding an assert next to the very relevant sounding FIXME like so:<br class=""><br class="">--- a/include/clang/Lex/Preprocessor.h<br class="">+++ b/include/clang/Lex/Preprocessor.h<br class="">@@ -454,6 +454,7 @@ class Preprocessor : public RefCountedBase<Preprocessor> {<br class="">     MacroDirective::DefInfo findDirectiveAtLoc(SourceLocation Loc,<br class="">                                                SourceManager &SourceMgr) const {<br class="">       // FIXME: Incorporate module macros into the result of this.<br class="">+      assert(getLatest() != nullptr);<br class="">       return getLatest()->findDirectiveAtLoc(Loc, SourceMgr);<br class="">     }<br class=""><br class="">I found this with ubsan, but I still need a couple of clang patches<br class="">reviewed before I can make a bot to catch such things. For anyone<br class="">interested:<br class=""><br class="">  <a href="http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20150622/131431.html" class="">http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20150622/131431.html</a><br class="">  <a href="http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20150622/131432.html" class="">http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20150622/131432.html</a><br class="">  <a href="http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20150622/131433.html" class="">http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20150622/131433.html</a><br class=""></div></div></blockquote></div><br class=""><div class="">Hm, thanks. I'm not sure whether this means we/I should be more circumspect about what gets added to the Macros table, or whether findDirectiveAtLoc should not assume that everything in the Macros table is currently valid.</div><div class=""><br class=""></div><div class="">Jordan</div></body></html>