Page MenuHomeFreeBSD

Minor sed cleanups
AcceptedPublic

Authored by arichardson on Feb 9 2021, 5:31 PM.
Tags
None
Referenced Files
Unknown Object (File)
Feb 10 2024, 3:22 AM
Unknown Object (File)
Dec 20 2023, 6:50 AM
Unknown Object (File)
Dec 19 2023, 5:01 PM
Unknown Object (File)
Aug 2 2023, 6:28 PM
Unknown Object (File)
Jul 15 2023, 10:28 PM
Unknown Object (File)
Jun 22 2023, 6:41 PM
Unknown Object (File)
May 3 2023, 9:28 PM
Unknown Object (File)
Apr 4 2023, 7:53 PM
Subscribers

Details

Reviewers
imp
emaste
Summary

sed: Fix a UBSan warning and clean up a pedantic few compiler warnings

This avoids adding a zero offset to a NULL pointer, but written in such
a way that the compiler can generate the same code as before. While
touching this file also clean up a few signed/unsigned warnings.

usr.bin/sed: Speed up vector grow

Double the size when we run out of space instead of using 1K at a time.
I noticed this while debugging an infinite loop due to
https://github.com/google/sanitizers/issues/1371

usr.bin/sed: Add an assertion that REG_STARTEND

This was helpful while tracking down an ASan interceptor bug
(https://github.com/google/sanitizers/issues/1371).

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 36834
Build 33723: arc lint + arc unit

Event Timeline

I think this is fine, though I'd be tempted to fix NEEDSP so that its invocations require a ';'.... though I was lazy and didn't look to see if that was possible...

usr.bin/sed/process.c
742

this looks odd w/o the ;

This revision is now accepted and ready to land.Nov 29 2022, 12:33 AM