diff options
author | Christian Kandeler <christian.kandeler@qt.io> | 2022-10-12 17:14:07 +0200 |
---|---|---|
committer | Christian Kandeler <christian.kandeler@qt.io> | 2022-10-14 08:38:25 +0000 |
commit | e0f7b42f9a37798e5721f7ee91d5543645c81a9b (patch) | |
tree | 57597d23061d1bb116184ce82f44c37f0b939f28 | |
parent | 5499319bd5edbee1b10bdbaa4f4b286cf398f492 (diff) |
Fix possible crash in Executor
Amends d8d7beb866b24793d9c04b6996276a4a8959bfa2.
Change-Id: I6eefff5640ad1213e2ae36d7f71ba476ea4d475b
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
-rw-r--r-- | src/lib/corelib/buildgraph/executor.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/lib/corelib/buildgraph/executor.cpp b/src/lib/corelib/buildgraph/executor.cpp index 06d49cb4d..72ee9d7ba 100644 --- a/src/lib/corelib/buildgraph/executor.cpp +++ b/src/lib/corelib/buildgraph/executor.cpp @@ -396,8 +396,10 @@ bool Executor::schedulingBlockedByJobLimit(const BuildGraphNode *node) if (currentJobCount == 0) continue; const auto jobLimitIsExceeded = [currentJobCount, jobPool, this](const Transformer *t) { - const int maxJobCount = m_jobLimitsPerProduct.at(t->product().get()) - .getLimit(jobPool); + const auto it = m_jobLimitsPerProduct.find(t->product().get()); + if (it == m_jobLimitsPerProduct.cend()) + return false; // See checkNodeProduct() for why this is possible + const int maxJobCount = it->second.getLimit(jobPool); return maxJobCount > 0 && currentJobCount >= maxJobCount; }; |