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)
May 11 2024, 11:25 PM
Unknown Object (File)
May 11 2024, 11:25 PM
Unknown Object (File)
May 11 2024, 1:42 AM
Unknown Object (File)
May 10 2024, 12:45 PM
Unknown Object (File)
May 10 2024, 12:12 PM
Unknown Object (File)
Mar 17 2024, 1:43 AM
Unknown Object (File)
Jan 18 2024, 7:11 AM
Unknown Object (File)
Jan 6 2024, 4:48 AM
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

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 9925
Build 10360: arc lint + arc unit

Event Timeline

cem added inline comments.
lib/libc/regex/engine.c
870

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

walk inside of assert() is OK?

lib/libc/regex/engine.c
482

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.