work around compiler fault

This commit is contained in:
David Rose 2001-08-05 20:43:16 +00:00
parent bf65f5baf7
commit 06fb9edb9b
1 changed files with 10 additions and 3 deletions

View File

@ -3056,11 +3056,12 @@ r_find_matches(NodePathCollection &result,
num_levels_remaining--;
FindApproxLevel next_level;
bool okflag = true;
// For each node in the current level, build up the set of possible
// matches in the next level.
FindApproxLevel::Vec::const_iterator li;
for (li = level._v.begin(); li != level._v.end(); ++li) {
for (li = level._v.begin(); li != level._v.end() && okflag; ++li) {
const FindApproxLevelEntry &entry = (*li);
if (entry.is_solution()) {
@ -3071,12 +3072,18 @@ r_find_matches(NodePathCollection &result,
}
if (max_matches > 0 && result.get_num_paths() >= max_matches) {
return;
// Really, we just want to return here. But returning from
// within the conditional within the for loop seems to sometimes
// cause a compiler fault in GCC. We'll use a semaphore
// variable instead.
okflag = false;
}
}
// Now recurse on the next level.
r_find_matches(result, next_level, max_matches, num_levels_remaining);
if (okflag) {
r_find_matches(result, next_level, max_matches, num_levels_remaining);
}
}
////////////////////////////////////////////////////////////////////