[cfe-dev] Can we assert-fail earlier when reading bad PCH files?

Richard Smith via cfe-dev cfe-dev at lists.llvm.org
Mon Nov 2 09:51:47 PST 2015


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.
On Nov 2, 2015 9:43 AM, "Vedant Kumar via cfe-dev" <cfe-dev at lists.llvm.org>
wrote:

> Hi,
>
> 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?
>
> For example, we could change ASTReader::ReadControlBlock to do this:
>
>
> 2267    switch ((ControlRecordTypes)Stream.readRecord(Entry.ID, Record,
> &Blob)) {
> 2268    case METADATA: {
> 2269      assert(Record.size() >= 8 && "malformed control block in
> module"); // New
>
>
> Currently we hit an 'index out of bound' assertion in SmallVector when
> reading stale PCH files.
>
> I can send a patch in if this seems worthwhile.
>
> vedant
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20151102/f88dfee9/attachment.html>


More information about the cfe-dev mailing list