Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: [PATCH 0/3] jp: Patchset for parameter expansion segfaults

On Sun, Jan 14, 2018 at 7:23 AM, Joey Pabalinas <joeypabalinas@xxxxxxxxx> wrote:
> Joey Pabalinas (3):
>   - Fix segfaults during parameter expansion
>   - Use `(nil)` for empty identifier strings
>   - Add `dupstring()` fallback to `zhtricat()`

With appreciation for your efforts here, preventing segfaults is not
the correct goal.  The goal should be that the software produces the
correct results.

Trapping bad pointers in the string copy/catenate routines potentially
masks more serious errors; it introduces what only appears to be
error-free operation in cases that probably ought to fail.  A segfault
in zhtricat() is nearly always an indication that the calling code is
doing something wrong, and covering that up only makes it harder to
find what that is.

At the very least any such "succeed in spite of caller screwup" code
should be wrapped in #ifndef DEBUG or the like.

Messages sorted by: Reverse Date, Date, Thread, Author