From 84ce1f7929cdf328f486cdebc678baf8d0e15152 Mon Sep 17 00:00:00 2001 From: Changhai Man Date: Fri, 19 Jan 2024 17:30:44 -0500 Subject: [PATCH] [ETFeeder] fix out of boundary bug in lookupNode func --- et_feeder/et_feeder.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/et_feeder/et_feeder.cpp b/et_feeder/et_feeder.cpp index 714b5d6d..061a811d 100644 --- a/et_feeder/et_feeder.cpp +++ b/et_feeder/et_feeder.cpp @@ -54,7 +54,13 @@ void ETFeeder::pushBackIssuableNode(uint64_t node_id) { } shared_ptr ETFeeder::lookupNode(uint64_t node_id) { - return dep_graph_[node_id]; + try { + return dep_graph_.at(node_id); + } catch (const std::out_of_range& e) { + std::cerr << "looking for node_id=" << node_id + << " in dep graph, however, not loaded yet" << std::endl; + throw(e); + } } void ETFeeder::freeChildrenNodes(uint64_t node_id) {