<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/gnulib.git/modules/dfa, branch python</title>
<subtitle>git.savannah.gnu.org: git/gnulib.git
</subtitle>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gnulib.git/'/>
<entry>
<title>dfa: port to older GCC</title>
<updated>2017-01-10T22:36:13+00:00</updated>
<author>
<name>Paul Eggert</name>
<email>eggert@cs.ucla.edu</email>
</author>
<published>2017-01-10T22:35:34+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gnulib.git/commit/?id=916a632413a6c0af72c7b61f36e3eb8400b858cc'/>
<id>916a632413a6c0af72c7b61f36e3eb8400b858cc</id>
<content type='text'>
Problem reported by Assaf Gordon in:
http://lists.gnu.org/archive/html/bug-gnulib/2017-01/msg00103.html
* modules/c99: New module.  This merely attempts to use the latest
C version, which should be enough to solve this particular problem.
The idea is to document which Gnulib modules assume C99 or later.
* modules/dfa (Depends-on): Add it.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Problem reported by Assaf Gordon in:
http://lists.gnu.org/archive/html/bug-gnulib/2017-01/msg00103.html
* modules/c99: New module.  This merely attempts to use the latest
C version, which should be enough to solve this particular problem.
The idea is to document which Gnulib modules assume C99 or later.
* modules/dfa (Depends-on): Add it.
</pre>
</div>
</content>
</entry>
<entry>
<title>dfa: fix some unlikely integer overflows</title>
<updated>2016-12-14T21:38:10+00:00</updated>
<author>
<name>Paul Eggert</name>
<email>eggert@cs.ucla.edu</email>
</author>
<published>2016-12-14T21:21:04+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gnulib.git/commit/?id=5ec9a7edc2341847e54c84edf2cc66606dff42d6'/>
<id>5ec9a7edc2341847e54c84edf2cc66606dff42d6</id>
<content type='text'>
I found these while reviewing the recent Coverity-related fix.
This patch changes part of dfa.c to prefer ptrdiff_t instead of
size_t for object counts.  Using ptrdiff_t is the style typically
used in Emacs; although it wastes a sign bit as sizes can never be
negative, it makes -fsanitize=undefined more likely to catch
integer overflows in index calculation, and nowadays the upside is
typically more important than the downside.  Although perhaps the
rest of dfa.c should be changed to prefer ptrdiff_t as well (much
of dfa.c already does, since it uses state_num which is signed),
that is a bigger change and is not needed to fix the bugs I found.
* lib/dfa.c: Include stdint.h and intprops.h.
(TOKEN_MAX): New macro.
(position_set, struct mb_char_classes, struct dfa, maybe_realloc)
(charclass_index, parse_bracket_exp, addtok, insert, merge)
(realloc_trans_if_necessary, free_mbdata):
Use ptrdiff_t instead of size_t for object counts related to xpalloc.
This is safe because xpalloc checks that the sizes do not exceed
either SIZE_MAX or PTRDIFF_MAX.
(xpalloc): New function, mostly taken from Emacs.
(maybe_realloc, copy, realloc_trans_if_necessary): Use it.
(maybe_realloc): Add NITEMS_MAX to signature.  All callers changed.
(charclass_index): Check for integer overflow in computing
charclass index; it must not exceed TOKEN_MAX - CSET, as CSET is
added to it later.
(alloc_position_set): Check for integer overflow.  On typical
platforms this check has zero overhead, since the constant
expression is false.
(realloc_trans_if_necessary):
Remove assertion, which I hope Coverity no longer needs.
* modules/dfa (Depends-on): Add intprops, stdint.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
I found these while reviewing the recent Coverity-related fix.
This patch changes part of dfa.c to prefer ptrdiff_t instead of
size_t for object counts.  Using ptrdiff_t is the style typically
used in Emacs; although it wastes a sign bit as sizes can never be
negative, it makes -fsanitize=undefined more likely to catch
integer overflows in index calculation, and nowadays the upside is
typically more important than the downside.  Although perhaps the
rest of dfa.c should be changed to prefer ptrdiff_t as well (much
of dfa.c already does, since it uses state_num which is signed),
that is a bigger change and is not needed to fix the bugs I found.
* lib/dfa.c: Include stdint.h and intprops.h.
(TOKEN_MAX): New macro.
(position_set, struct mb_char_classes, struct dfa, maybe_realloc)
(charclass_index, parse_bracket_exp, addtok, insert, merge)
(realloc_trans_if_necessary, free_mbdata):
Use ptrdiff_t instead of size_t for object counts related to xpalloc.
This is safe because xpalloc checks that the sizes do not exceed
either SIZE_MAX or PTRDIFF_MAX.
(xpalloc): New function, mostly taken from Emacs.
(maybe_realloc, copy, realloc_trans_if_necessary): Use it.
(maybe_realloc): Add NITEMS_MAX to signature.  All callers changed.
(charclass_index): Check for integer overflow in computing
charclass index; it must not exceed TOKEN_MAX - CSET, as CSET is
added to it later.
(alloc_position_set): Check for integer overflow.  On typical
platforms this check has zero overhead, since the constant
expression is false.
(realloc_trans_if_necessary):
Remove assertion, which I hope Coverity no longer needs.
* modules/dfa (Depends-on): Add intprops, stdint.
</pre>
</div>
</content>
</entry>
<entry>
<title>dfa: port to Solaris 9</title>
<updated>2016-09-11T23:13:46+00:00</updated>
<author>
<name>Paul Eggert</name>
<email>eggert@cs.ucla.edu</email>
</author>
<published>2016-09-11T23:13:11+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gnulib.git/commit/?id=04b939c3a71636c23df6709ebc57ecd920bfbaf9'/>
<id>04b939c3a71636c23df6709ebc57ecd920bfbaf9</id>
<content type='text'>
Problems reported by Tom G. Christensen in:
http://lists.gnu.org/archive/html/bug-gnulib/2016-09/msg00031.html
* modules/dfa (Depends-on): Add isblank.
* modules/dfa-tests (dfa_match_aux_LDADD):
Rename from test_stat_LDADD, to fix typo.
* tests/dfa-match.sh: Don't require 'timeout'; use it if available.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Problems reported by Tom G. Christensen in:
http://lists.gnu.org/archive/html/bug-gnulib/2016-09/msg00031.html
* modules/dfa (Depends-on): Add isblank.
* modules/dfa-tests (dfa_match_aux_LDADD):
Rename from test_stat_LDADD, to fix typo.
* tests/dfa-match.sh: Don't require 'timeout'; use it if available.
</pre>
</div>
</content>
</entry>
<entry>
<title>dfa: new module, importing grep's DFA matcher</title>
<updated>2016-09-10T05:00:16+00:00</updated>
<author>
<name>Jim Meyering</name>
<email>meyering@fb.com</email>
</author>
<published>2016-08-16T22:00:43+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gnulib.git/commit/?id=286720379e41c68e3a455cf0f53487a8018c7838'/>
<id>286720379e41c68e3a455cf0f53487a8018c7838</id>
<content type='text'>
Since grep's DFA matcher is now being used by two gnulib-enabled
projects, grep and sed, it makes sense to version-control its
sources and unit tests in one place: here.
* modules/dfa: New module.
* modules/dfa-tests: New file.
* lib/dfa.c: New file, from grep.
* lib/dfa.h: Likewise.
* lib/localeinfo.c: Likewise.
* lib/localeinfo.h: Likewise.
* tests/dfa-match-aux.c: Likewise.
* tests/dfa-invalid-char-class.sh: Likewise.
* tests/dfa-match.sh: Likewise, with minor changes.
* MODULES.html.sh (Misc): Add "dfa" to this list.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Since grep's DFA matcher is now being used by two gnulib-enabled
projects, grep and sed, it makes sense to version-control its
sources and unit tests in one place: here.
* modules/dfa: New module.
* modules/dfa-tests: New file.
* lib/dfa.c: New file, from grep.
* lib/dfa.h: Likewise.
* lib/localeinfo.c: Likewise.
* lib/localeinfo.h: Likewise.
* tests/dfa-match-aux.c: Likewise.
* tests/dfa-invalid-char-class.sh: Likewise.
* tests/dfa-match.sh: Likewise, with minor changes.
* MODULES.html.sh (Misc): Add "dfa" to this list.
</pre>
</div>
</content>
</entry>
</feed>
