Mercurial > hg > Applications > Grep
diff regexParser/cerium/ppe/Exec.cc @ 282:87a801c14117
fix match condition (parallel search doesn't work)
author | Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Sun, 31 Jan 2016 19:53:58 +0900 |
parents | b74e3b4b11d7 |
children | f2491681914e |
line wrap: on
line diff
--- a/regexParser/cerium/ppe/Exec.cc Sun Jan 31 18:28:58 2016 +0900 +++ b/regexParser/cerium/ppe/Exec.cc Sun Jan 31 19:53:58 2016 +0900 @@ -30,15 +30,17 @@ tsv = tSearch(tsv); tsv.blockEnd = tsv.current; if (tsv.blockEnd->state->bitState.bitContainer != 1) { - // partial match case at block end. - ResultPtr r = NEW(Result); - r->continued = true; - r->begin = tsv.buff.matchBegin; - r->end = tsv.buff.buffptr-1; - *tsv.resultEnd = r; - r->next = NULL; - tsv.resultEnd = &r->next; + if (tsv.buff.matchBegin != tsv.buff.buffptr) { + // partial match case at block end. + ResultPtr r = NEW(Result); + r->continued = true; + r->begin = tsv.buff.matchBegin; + r->end = tsv.buff.buffptr; + *tsv.resultEnd = r; + r->next = NULL; + tsv.resultEnd = &r->next; // printf("Exec %lx r->begin : %p r->end : %p\n",tsv.blockEnd->state->bitState.bitContainer, r->begin,r->end); + } } tsv.result = result; return tsv;