mirror of
https://github.com/Kitware/CMake.git
synced 2026-02-20 14:10:27 -06:00
Merge topic 'cmuvprocesschain-iterator-fix'
dfa24355ea cmUVProcessChain: Add assert() for static analysis tools
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3322
This commit is contained in:
@@ -8,6 +8,8 @@
|
||||
#include "cmUVStreambuf.h"
|
||||
#include "cm_uv.h"
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
#include <iterator>
|
||||
#include <memory>
|
||||
#include <utility>
|
||||
@@ -250,7 +252,8 @@ bool cmUVProcessChain::InternalData::AddCommand(
|
||||
if (first) {
|
||||
stdio[0].flags = UV_IGNORE;
|
||||
} else {
|
||||
auto& prev = **std::prev(this->Processes.end(), 2);
|
||||
assert(this->Processes.size() >= 2);
|
||||
auto& prev = *this->Processes[this->Processes.size() - 2];
|
||||
stdio[0].flags = UV_INHERIT_STREAM;
|
||||
stdio[0].data.stream = prev.OutputPipe;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user