[PATCH] D117067: [Bitcode] Mention that a multi-module bitcode is valid, each module has exactly one MODULE_BLOCK block

Mingming Liu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 18 17:32:07 PST 2022


luna added a comment.

In D117067#3245194 <https://reviews.llvm.org/D117067#3245194>, @tejohnson wrote:

> lgtm on the documentation change but that should be submitted separately as it is unrelated to the code fix.
> The other change lgtm but if it is feasible to add a test that would be ideal.

thanks! I revise this patch to be doc-only, and reformat, and going to pursue bitcode reader change in https://reviews.llvm.org/D117630

The patch is still a draft and I'll see how to add a test (probably an invalid bitcode is needed to trigger the condition);

> What's the behavior without the fix

I think upon hitting the branch, trying to call `get` will run into assertions (with the asserted condition being false); yet it happens very rarely (if at all) since most of time, bitcode file should be valid.

I'll see if there is a lightweight way to construct the bitcode to have a test (maybe by hacking bitcode writer to generate an invalid record).


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D117067/new/

https://reviews.llvm.org/D117067



More information about the llvm-commits mailing list