changeset 285:3ea12df96bcf

add *tsvp
author Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
date Sun, 31 Jan 2016 21:08:34 +0900
parents 5d23dc02f60d
children 555ca452f031
files regexParser/threadedSearch.cc
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/regexParser/threadedSearch.cc	Sun Jan 31 20:39:19 2016 +0900
+++ b/regexParser/threadedSearch.cc	Sun Jan 31 21:08:34 2016 +0900
@@ -45,6 +45,7 @@
     }
     if (ccvSize == 0) {
         tState->ccv = NULL;
+        state->tState = tState;
         return tState;
     } else tState->ccv = (ccv*)malloc(sizeof(ccv)*ccvSize);
     ccw = createCharClassWalker(state->cc);
@@ -81,6 +82,7 @@
 }
 
 TSValue tSearch(TSValue tsv) {
+    TSValuePtr tsvp = &tsv;
     next: while (tsv.buff.buffptr < tsv.buff.buffend) {
         unsigned char c = *tsv.buff.buffptr++;
 //        printState(tsv.current->state);
@@ -107,7 +109,8 @@
         }
         tsv = tsv.current->stateSkip(tsv);
     }
-    return tsv;
+    *tsvp = tsv;
+    return *tsvp;
 }
 
 void threadedSearch(TransitionGeneratorPtr tg, Buffer buff) {