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:
@@ -415,6 +415,13 @@ Worker::WaitForJob(Job* waitingJob, const JobKey& key)
|
|||||||
if (job == NULL)
|
if (job == NULL)
|
||||||
return JOB_DEPENDENCY_NOT_FOUND;
|
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->SetWaitStatus(JOB_DEPENDENCY_ACTIVE);
|
||||||
waitingJob->SetDependency(job);
|
waitingJob->SetDependency(job);
|
||||||
job->DependentJobs().Add(waitingJob);
|
job->DependentJobs().Add(waitingJob);
|
||||||
|
|||||||
Reference in New Issue
Block a user