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)
Sun, Oct 5, 5:00 AM
Unknown Object (File)
Sun, Sep 28, 1:27 PM
Unknown Object (File)
Thu, Sep 25, 6:32 PM
Unknown Object (File)
Wed, Sep 24, 8:06 PM
Unknown Object (File)
Wed, Sep 24, 3:53 AM
Unknown Object (File)
Mon, Sep 22, 2:05 PM
Unknown Object (File)
Thu, Sep 18, 12:15 AM
Unknown Object (File)
Sep 15 2025, 12:24 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.