[all-commits] [llvm/llvm-project] 2b898a: [llvm] Add comment and assert for CloneModule edge...

Jacob Lambert via All-commits all-commits at lists.llvm.org
Wed Nov 1 10:05:25 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 2b898afdef7c8f40e74af9379a1cc7cf372ecb65
      https://github.com/llvm/llvm-project/commit/2b898afdef7c8f40e74af9379a1cc7cf372ecb65
  Author: Jacob Lambert <39344363+lamb-j at users.noreply.github.com>
  Date:   2023-11-01 (Wed, 01 Nov 2023)

  Changed paths:
    M llvm/lib/Transforms/Utils/CloneModule.cpp

  Log Message:
  -----------
  [llvm] Add comment and assert for CloneModule edge case (#67734)

CloneModule is not currently designed to handle un-materialized Modules,
for example one created via a lazy initializer like
getLazyBitcodeModule(). In this case we get a somewhat cryptic
segmentation fault without a clear path forward.

In this patch, we add a comment to inform CloneModule users of this
shortcoming, and an assert to test for empty function bodies before the
segmentation fault is triggered.




More information about the All-commits mailing list