mirror of https://gitee.com/bigwinds/arangodb
Fix stack-use-after-scope of AqlItemBlockManager (inside SingleRowFetcherHelper) (#8609)
This commit is contained in:
parent
f2455786a7
commit
670f9c662e
|
@ -211,7 +211,7 @@ static void ValidateResult(ShortestPathExecutorInfos& infos, OutputAqlItemRow& r
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
static void TestExecutor(ShortestPathExecutorInfos& infos,
|
static void TestExecutor(ShortestPathExecutorInfos& infos,
|
||||||
std::shared_ptr<VPackBuilder> input,
|
std::shared_ptr<VPackBuilder> const& input,
|
||||||
std::vector<std::pair<std::string, std::string>> const& resultPaths) {
|
std::vector<std::pair<std::string, std::string>> const& resultPaths) {
|
||||||
ResourceMonitor monitor;
|
ResourceMonitor monitor;
|
||||||
AqlItemBlockManager itemBlockManager{&monitor};
|
AqlItemBlockManager itemBlockManager{&monitor};
|
||||||
|
@ -221,12 +221,11 @@ static void TestExecutor(ShortestPathExecutorInfos& infos,
|
||||||
ExecutionState state = ExecutionState::HASMORE;
|
ExecutionState state = ExecutionState::HASMORE;
|
||||||
auto outputBlockShell =
|
auto outputBlockShell =
|
||||||
std::make_unique<AqlItemBlockShell>(itemBlockManager, std::move(block));
|
std::make_unique<AqlItemBlockShell>(itemBlockManager, std::move(block));
|
||||||
|
auto& finder = dynamic_cast<FakePathFinder&>(infos.finder());
|
||||||
OutputAqlItemRow result(std::move(outputBlockShell), infos.getOutputRegisters(),
|
|
||||||
infos.registersToKeep(), infos.registersToClear());
|
|
||||||
FakePathFinder& finder = static_cast<FakePathFinder&>(infos.finder());
|
|
||||||
WHEN("not waiting") {
|
WHEN("not waiting") {
|
||||||
SingleRowFetcherHelper<false> fetcher(input->steal(), false);
|
SingleRowFetcherHelper<false> fetcher(input->steal(), false);
|
||||||
|
OutputAqlItemRow result(std::move(outputBlockShell), infos.getOutputRegisters(),
|
||||||
|
infos.registersToKeep(), infos.registersToClear());
|
||||||
ShortestPathExecutor testee(fetcher, infos);
|
ShortestPathExecutor testee(fetcher, infos);
|
||||||
// Fetch fullPath
|
// Fetch fullPath
|
||||||
for (size_t i = 0; i < resultPaths.size(); ++i) {
|
for (size_t i = 0; i < resultPaths.size(); ++i) {
|
||||||
|
@ -253,6 +252,8 @@ static void TestExecutor(ShortestPathExecutorInfos& infos,
|
||||||
}
|
}
|
||||||
WHEN("waiting") {
|
WHEN("waiting") {
|
||||||
SingleRowFetcherHelper<false> fetcher(input->steal(), true);
|
SingleRowFetcherHelper<false> fetcher(input->steal(), true);
|
||||||
|
OutputAqlItemRow result(std::move(outputBlockShell), infos.getOutputRegisters(),
|
||||||
|
infos.registersToKeep(), infos.registersToClear());
|
||||||
ShortestPathExecutor testee(fetcher, infos);
|
ShortestPathExecutor testee(fetcher, infos);
|
||||||
// Fetch fullPath
|
// Fetch fullPath
|
||||||
for (size_t i = 0; i < resultPaths.size(); ++i) {
|
for (size_t i = 0; i < resultPaths.size(); ++i) {
|
||||||
|
|
Loading…
Reference in New Issue