<p dir="ltr">We shouldn't be asserting on out-of-date module files at all, we should be cleanly failing with the "module file is out of date" error code.</p>
<div class="gmail_quote">On Nov 2, 2015 9:43 AM, "Vedant Kumar via cfe-dev" <<a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
I've noticed that the compiler assert-fails pretty far down the call stack when reading out-of-date PCH files. Can we assert-fail a bit earlier?<br>
<br>
For example, we could change ASTReader::ReadControlBlock to do this:<br>
<br>
<br>
2267 switch ((ControlRecordTypes)Stream.readRecord(Entry.ID, Record, &Blob)) {<br>
2268 case METADATA: {<br>
2269 assert(Record.size() >= 8 && "malformed control block in module"); // New<br>
<br>
<br>
Currently we hit an 'index out of bound' assertion in SmallVector when reading stale PCH files.<br>
<br>
I can send a patch in if this seems worthwhile.<br>
<br>
vedant<br>
_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><br>
</blockquote></div>