Mercurial > hg > Applications > Grep
diff regexParser/cerium/ppe/Exec.cc @ 275:8879eb8c64a8
remove segmentation fault
author | Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Sat, 30 Jan 2016 19:06:41 +0900 |
parents | 5aa9d01926f1 |
children | 99d635926ef3 |
line wrap: on
line diff
--- a/regexParser/cerium/ppe/Exec.cc Fri Jan 29 20:41:34 2016 +0900 +++ b/regexParser/cerium/ppe/Exec.cc Sat Jan 30 19:06:41 2016 +0900 @@ -41,6 +41,8 @@ tsv.result = NULL; tsv.resultEnd = &tsv.result; tsv.current = tg->anyState->tState; + tsv.current->stateSkip = stateSkip; + tsv.current->stateContinue = stateNothing; tsv.tg->stateSkip = stateSkip; tsv.tg->stateMatch = stateMatch; tsv.tg->stateNothing = stateNothing; @@ -67,7 +69,7 @@ { long task_spwaned = (long)s->get_param(0); long division_size = (long)s->get_param(1); - // long length = (long)s->get_param(2); + long length = (long)s->get_param(2); long out_size = (long)s->get_param(3); MapReduce *w = (MapReduce*)s->get_param(4); long allocation = task_spwaned + (long)s->x; @@ -83,10 +85,10 @@ TransitionGeneratorPtr tg = (TransitionGeneratorPtr)w->global; Buffer buff; buff.buff = buff.buffptr = buff.matchBegin = i_data; - buff.buffend = buff.buff + division_size; + buff.buffend = buff.buff + length; TSValue tsv = blockSearch(tg,buff); o_data[0] = (unsigned long)tsv.result; - o_data[1] = (unsigned long)tsv.blockBegin; - o_data[2] = (unsigned long)tsv.blockEnd; + o_data[1] = (unsigned long)tsv.blockBegin->state; + o_data[2] = (unsigned long)tsv.blockEnd->state; return 0; }