mirror of
https://github.com/DreamSourceLab/DSView.git
synced 2025-01-23 13:42:55 +08:00
fix: The edge search position out of range, so the finding loop can't break
This commit is contained in:
parent
a048fb9e97
commit
b9cdb4d76f
@ -1236,8 +1236,8 @@ bool LogicSnapshot::pattern_search_self(int64_t start, int64_t end, int64_t &ind
|
||||
int count = 0;
|
||||
bool bEdgeFlag = false;
|
||||
|
||||
int64_t to = isNext ? end + 1 : start - 1;
|
||||
int64_t step = isNext ? 1 : -1;
|
||||
const int64_t to = isNext ? end + 1 : start - 1;
|
||||
const int64_t step = isNext ? 1 : -1;
|
||||
|
||||
for (auto it = pattern.begin(); it != pattern.end(); it++){
|
||||
char flag = *(it->second.toStdString().c_str());
|
||||
@ -1270,6 +1270,13 @@ bool LogicSnapshot::pattern_search_self(int64_t start, int64_t end, int64_t &ind
|
||||
index += step;
|
||||
}
|
||||
|
||||
if (index < start){
|
||||
index = start;
|
||||
}
|
||||
if (index > end){
|
||||
index = end;
|
||||
}
|
||||
|
||||
while (index != to)
|
||||
{
|
||||
macthed = 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user