From c5fa5b7c1cb24bfa4cb1b7366443b9465aa757dc Mon Sep 17 00:00:00 2001 From: thurston Date: Fri, 11 Jan 2008 02:47:13 +0000 Subject: [PATCH] Don't allow the left machine of <: to escape through the right machine via the empty string. git-svn-id: svn://mambo.cs.queensu.ca/ragel/trunk@395 052ea7fc-9027-0410-9066-f65837a77df0 --- ragel/parsetree.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ragel/parsetree.cpp b/ragel/parsetree.cpp index 6725378..c95921f 100644 --- a/ragel/parsetree.cpp +++ b/ragel/parsetree.cpp @@ -889,14 +889,14 @@ FsmAp *Term::walk( ParseData *pd, bool lastInSeq ) priorDescs[0].priority = 1; rtnVal->allTransPrior( pd->curPriorOrd++, &priorDescs[0] ); - /* The right machine gets the lower priority. Since - * startTransPrior might unnecessarily increase the number of - * states during the state machine construction process (due to - * isolation), we use allTransPrior instead, which has the same - * effect. */ + /* The right machine gets the lower priority. We cannot use + * allTransPrior here in case the start state of the right machine + * is final. It would allow the right machine thread to run along + * with the left if just passing through the start state. Using + * startFsmPrior prevents this. */ priorDescs[1].key = priorDescs[0].key; priorDescs[1].priority = 0; - rhs->allTransPrior( pd->curPriorOrd++, &priorDescs[1] ); + rhs->startFsmPrior( pd->curPriorOrd++, &priorDescs[1] ); /* Perform concatenation. */ rtnVal->concatOp( rhs ); -- 2.11.4.GIT