Page MenuHomeFreeBSD

regex(3): Refactor fast/slow stepping bits in the matching engine
ClosedPublic

Authored by kevans on Jun 16 2017, 3:00 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Nov 16, 10:01 AM
Unknown Object (File)
Tue, Nov 12, 9:21 PM
Unknown Object (File)
Oct 1 2024, 3:02 AM
Unknown Object (File)
Sep 30 2024, 5:19 PM
Unknown Object (File)
Sep 27 2024, 2:50 PM
Unknown Object (File)
Sep 27 2024, 3:10 AM
Unknown Object (File)
Sep 16 2024, 3:00 AM
Unknown Object (File)
Sep 15 2024, 3:17 PM
Subscribers
None

Details

Summary

Adding features for matching is fairly straightforward, but requires some
duplication because of this fast/slow setup. They can be fairly trivially combined
into a single walk(), so do it to make it less error prone.

Test Plan

Run regex(3), sed, grep, gsed tests

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

cem added inline comments.
lib/libc/regex/engine.c
870 ↗(On Diff #29697)

style nit: spaces around +

This revision is now accepted and ready to land.Jun 17 2017, 7:29 PM
kevans edited edge metadata.
  • Address style nit
This revision now requires review to proceed.Jun 19 2017, 12:57 AM
This revision is now accepted and ready to land.Jun 19 2017, 4:52 PM
lib/libc/regex/engine.c
482 ↗(On Diff #29804)

walk inside of assert() is OK?

lib/libc/regex/engine.c
482 ↗(On Diff #29804)

I believe in this case it should be fine; it's a sanity walk that shouldn't alter state since we should have exhausted the substring at that point.

This revision was automatically updated to reflect the committed changes.