[llvm-bugs] [Bug 42311] New: BitStream reader ignores errors

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Jun 18 13:35:55 PDT 2019


            Bug ID: 42311
           Summary: BitStream reader ignores errors
           Product: clang
           Version: trunk
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Frontend
          Assignee: unassignedclangbugs at nondot.org
          Reporter: llvm-bugzilla at jfbastien.com
                CC: llvm-bugs at lists.llvm.org, neeilans at live.com,
                    richard-llvm at metafoo.co.uk

The bitstream reader handles errors poorly. The has two effects:

 * Bugs in file handling (especially modules) manifest as an "unexpected end of
file" crash
 * Users of clang as a library end up aborting because the code unconditionally
calls `report_fatal_error`

The bitstream reader should be more resilient and return Expected / Error as
soon as an error is encountered, not way late like it does now.

This will take a few changes to get to: propagating the errors is a huge patch!
As we propagate them there's places where we can offer better diagnostics (for
example, the file's name, or where we were in the file / what we were parsing).

Further, many places ignore filesystem errors. Those should be nodiscard.

You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20190618/86b95a4d/attachment.html>

More information about the llvm-bugs mailing list