<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">FYI I changed this to early-exit again in r260563 to fix implicit builds.  It’s not safe to keep reading if we haven’t told ReadOptionsBlock to expect failures, since it will itself early-exit, leaving the stream in the middle of a block.  It’s also a performance advantage to early exit when doing implicit builds.<div class=""><br class=""></div><div class="">Ben</div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Jan 8, 2016, at 2:46 PM, Adrian Prantl via cfe-commits <<a href="mailto:cfe-commits@lists.llvm.org" class="">cfe-commits@lists.llvm.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><blockquote type="cite" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br class="Apple-interchange-newline">On Jan 8, 2016, at 2:39 PM, Adrian Prantl <<a href="mailto:aprantl@apple.com" class="">aprantl@apple.com</a>> wrote:<br class=""><br class="">Hi Richard,<br class=""><br class="">This change<span class="Apple-converted-space"> </span><br class=""><blockquote type="cite" class="">@@ -2239,16 +2240,21 @@ ASTReader::ReadControlBlock(ModuleFile &F,<br class=""></blockquote>[...]<br class=""><blockquote type="cite" class="">-          if (!DisableValidation && Result != Success &&<br class="">-              (Result != ConfigurationMismatch || !AllowConfigurationMismatch))<br class="">+          if (DisableValidation ||<br class="">+              (AllowConfigurationMismatch && Result == ConfigurationMismatch))<br class="">+            Result = Success;<br class="">+<br class="">+          // If we've diagnosed a problem, we're done.<br class="">+          if (Result != Success &&<br class="">+              isDiagnosedResult(Result, ClientLoadCapabilities))<br class="">           return Result;<br class=""></blockquote><br class="">either causes or uncovers a bug:<br class=""><br class=""><blockquote type="cite" class="">CC=/Volumes/Data/llvm/_build.ninja.debug/bin/clang # r256948<br class="">rm -rf cache && mkdir cache<br class="">rm -rf Test && mkdir Test<br class="">echo 'module Test {<br class="">umbrella header "Test.h"<br class="">}' >Test/module.modulemap<br class="">touch Test/Test.h<br class="">echo '#import <Test/Test.h>'>2.m<br class=""><br class="">clang -x objective-c -fmodules -fmodules-cache-path=cache  -DA=0 -I. -c 2.m -o 1.o<br class="">clang -x objective-c -fmodules -fmodules-cache-path=cache -Werror -DA=0 -I. -c 2.m -o 2.o<br class=""><br class=""></blockquote><br class=""><br class="">After encountering a configuration mismatch or out-of-date error, we now continue instead of returning early and subsequently crash in<br class=""><br class="">ASTReader::ReadControlBlock()<br class="">  ASTReader::getInputFile()<br class="">    Cursor.JumpToBit(F.InputFileOffsets[ID-1]);<br class=""><br class="">I’ll keep digging deeper, but I thought you may have an intuition of what’s going on here.<br class="">Is the behavior change intentional? From the commit message it sounds as if implicit module builds shouldn’t be affected.<br class=""></blockquote><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">In my particular crash isDiagnosedResult returns false for an OutOfDate result thus skipping the early return.</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">-- adrian</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">_______________________________________________</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">cfe-commits mailing list</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><a href="mailto:cfe-commits@lists.llvm.org" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">cfe-commits@lists.llvm.org</a><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits</a></div></blockquote></div><br class=""></div></body></html>