bug-grep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#17328: dfa.c will fail if used on more than one DFA


From: Paul Eggert
Subject: bug#17328: dfa.c will fail if used on more than one DFA
Date: Wed, 23 Apr 2014 12:49:29 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0

Thanks for reporting that. That static variable was the result of a recent optimization. I guess we'll need to optimize in a different way. I noticed another static variable that dfaexec also uses, namely 'mbs'; this needs to be moved into the struct dfa, for the benefit of any applications that really need stateful encodings. A bonus is that I expect this'll make the dfa code run a bit faster. I installed the attached patch, which I hope addresses the issues you raised along with the mbs issue.

The code still needs more work in this area. There shouldn't be any static variables at all, even when parsing, though this would change the API. And the code isn't consistent about referring to dfa->mb_cur_max versus MB_CUR_MAX; not sure why that is.

Attachment: 0001-dfa-omit-static-variables-that-limited-dfaexec-to-on.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]