Debugger: Fix jobs trying to re-add dependencies.

Linked lists are used to manage these, so if we re-add
jobs we'll corrupt the linked lists and cause crashes.

Fixes #19864 and possibly others.
This commit is contained in:
Augustin Cavalier
2026-01-06 18:01:24 -05:00
parent 327215ce38
commit 6a1ad86129
+7
View File
@@ -415,6 +415,13 @@ Worker::WaitForJob(Job* waitingJob, const JobKey& key)
if (job == NULL)
return JOB_DEPENDENCY_NOT_FOUND;
if (waitingJob->Dependency() == job)
return waitingJob->WaitStatus();
if (job == waitingJob)
debugger("Jobs can't depend on themselves");
if (waitingJob->Dependency() != NULL)
debugger("Job already has a dependency");
waitingJob->SetWaitStatus(JOB_DEPENDENCY_ACTIVE);
waitingJob->SetDependency(job);
job->DependentJobs().Add(waitingJob);