llvm-project
e0f180ff - [JITLink] Handle errors after allocation for empty graphs (#242164)

Commit
14 hours ago
[JITLink] Handle errors after allocation for empty graphs (#242164) Graphs with no alloc actions and only NoAlloc sections skip memory allocation, so JITLinkerBase's Alloc member is null for the rest of the link. Any failure after the point where allocation would have happened (in a post-allocation, pre-fixup or post-fixup pass, in notifyResolved, or during fixup) goes through abandonAllocAndBailOut, which asserted that Alloc was non-null, and would have dereferenced null in release builds. It now reports the error directly when there is no allocation to abandon. The new JITLinkGenericPassErrorTest.FailingPassIsReported test adds a failing pass to each pass list in turn, for both an empty graph and a graph with one external symbol, and checks that the error is reported exactly once, that the link stops, and that the allocation (if any) is abandoned.
Author
Parents
Loading