Skip to content

Commit

Permalink
Fix for segfault SoarGroup#520
Browse files Browse the repository at this point in the history
  • Loading branch information
analog-cbarber committed Nov 13, 2024
1 parent 1ef7aa2 commit ad4b029
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions Core/SoarKernel/src/explanation_based_chunking/ebc_repair.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,14 +150,16 @@ void Repair_Manager::add_state_link_WMEs(goal_stack_level pTargetGoal, tc_number
void Repair_Manager::add_path_to_goal_WMEs(chunk_element* pTargetSym, tc_number cond_tc)
{
wme_list* l_WMEPath = find_path_to_goal_for_symbol(pTargetSym->instantiated_sym);
for (auto it = l_WMEPath->begin(); it != l_WMEPath->end(); it++)
{
wme* lWME = (*it);
if ((lWME->tc == cond_tc) && (lWME->value != pTargetSym->instantiated_sym))
if (l_WMEPath) {
for (auto it = l_WMEPath->begin(); it != l_WMEPath->end(); it++)
{
continue;
wme* lWME = (*it);
if ((lWME->tc == cond_tc) && (lWME->value != pTargetSym->instantiated_sym))
{
continue;
}
m_repair_WMEs.insert(lWME);
}
m_repair_WMEs.insert(lWME);
}
}

Expand Down

0 comments on commit ad4b029

Please sign in to comment.