[all-commits] [llvm/llvm-project] 3b2f87: [ORC] Use dyn_cast to check input type in StaticLi...

lhames via All-commits all-commits at lists.llvm.org
Wed Dec 6 14:02:26 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 3b2f8795093ce64209bd648231ecda85df28748a
      https://github.com/llvm/llvm-project/commit/3b2f8795093ce64209bd648231ecda85df28748a
  Author: Lang Hames <lhames at gmail.com>
  Date:   2023-12-06 (Wed, 06 Dec 2023)

  Changed paths:
    M llvm/lib/ExecutionEngine/Orc/ExecutionUtils.cpp
    A llvm/test/ExecutionEngine/JITLink/Generic/Inputs/main-ret-0.ll
    A llvm/test/ExecutionEngine/JITLink/Generic/error-object-passed-as-archive.test

  Log Message:
  -----------
  [ORC] Use dyn_cast to check input type in StaticLibraryDefinitionGenerator.

Replaces an llvm::cast that assumed that all Binary instances were either
Archive or MachOUniversalBinary instances with a dyn_cast. The cast was
triggering an assert in StaticLibraryDefinitionGenerator::Load if that method
was given a path or MemoryBuffer containing a relocatable object file.
Switching to dyn_cast causes the operation to error out with a bad-format
error as expected.

Fixes rdar://119262300




More information about the All-commits mailing list