[LLVMdev] Fwd: Bitcode abbreviations for something that's not a record

Filipe Cabecinhas filcab at gmail.com
Fri Jan 23 14:43:02 PST 2015


It's strictly better than leaving an assert/unreachable, since it's user
input, not bad API usage.
I'm not very familiar with BitcodeReader's API, so in this case I would
prefer to fix it right away, and later we could figure out how to make the
API recoverable.

Although:
In this case, we can return something like -1, for now, making some callers
skip over the thing or returning an error. The problem is: this is supposed
to be an abbrev record. If you can't read one of its parts, what do you do?
Otherwise, I can make readRecord return an std::error_code, since most of
its callers do the same, and propagate the error, since all of its callers
(AFAICT) return an error_code too.

  Filipe

On Fri, Jan 23, 2015 at 2:32 PM, Reid Kleckner <rnk at google.com> wrote:

> In general, are we OK with suppressing AFL assertion failures by calling
> report_fatal_error? I don't think we should exit(1) when encountering
> invalid bitcode. The caller might want to do something else. The bitcode
> reader should ideally be architected to fail safely.
>
> On Fri, Jan 23, 2015 at 2:16 PM, Filipe Cabecinhas <filcab at gmail.com>
> wrote:
>
>> Ok, I'll submit a patch to turn that into a report_fatal_error saying you
>> can't start an abbrev with an array or blob.
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150123/99883e10/attachment.html>


More information about the llvm-dev mailing list