Patch to BitcodeReader

Tom Roeder tmroeder at google.com
Thu Sep 12 13:05:32 PDT 2013


Performing the select as a regular instruction (%a = select ...) doesn't
trigger the bug. It has to end up with a CE_SELECT in the CONSTANTS block
of the bitcode file. However, I'm far from an expert in LLVM bitcode, so if
there's a smaller test case, I'd be happy to switch to it.


On Thu, Sep 12, 2013 at 12:52 PM, Tobias Grosser <tobias at grosser.es> wrote:

> On 09/12/2013 06:36 PM, Tom Roeder wrote:
>
>> Hi,
>>
>> Here is a patch that fixes decoding of CE_SELECT in BitcodeReader,
>> along with a simple test case. The problem in the current code is that
>> it generates but doesn't accept bitcode that uses vectors for the
>> first element of a select in this context.  Please let me know what
>> you think.
>>
>
> Hi Tom,
>
> nice catch!
>
> The test case does not seem minimal. Is there a reason to not just perform
> the select and return the result? Also, it might be nice to check that the
> disassembler decodes the result correctly. Otherwise this test may pass
> even if it prints out something incorrect, but something that does not
> crash.
>
> Otherwise, the patch looks good to me.
>
> Tobias
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130912/96be0598/attachment.html>


More information about the llvm-commits mailing list