This fixes a bug in ObjectLinkingLayer::computeBlockNonLocalDeps: The worklist needs to be built *after* all immediate dependencies / dependants are recorded, rather than trying to populate it as part of the same loop. (Trying to do the latter causes us to miss some blocks that should have been included in the worklist). This fixes a bug discovered by @Sahil123 on discord during work on out-of-process execution support in the clang-repl. No testcase yet. This *might* be testable with a unit test and a custom JITLinkContext but I believe some aspects of the algorithm depend on memory layout. I'll need to investigate that. Alternatively we could add llvm-jitlink testcases that exercise concurrent linking (and should probably do that anyway). Either option will require some investment and I don't want to hold this fix up in the mean time.
29 KiB
29 KiB