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

Re: [PATCH] isearch: do not use PAT_STATIC since we call zle hooks



On Jan 6,  5:25pm, m0viefreak wrote:
} Subject: [PATCH] isearch: do not use PAT_STATIC since we call zle hooks
}
} Using PAT_STATIC, any of the functions called in the hook that make
} use of patterns, implicitly change the pattern we use in the
} isearch loop. In the best case this results in pattern-not-found,
} in the worst case we get a dump.

This indicates that PAT_STATIC is unsafe anywhere signal queuing is
NOT in effect, because a trap handler could invoke pattern matching
in the same way.

PAT_STATIC already causes the compiled pattern to be placed on the heap,
so we could introduce a PAT_HEAPDUP that works like PAT_ZDUP except
there would be no need to explicity freepatprog().  Or we could look
for uses of PAT_STATIC and wrap them in queue_signals(), if the scope
is sufficiently narrow.

Either way we have to track down and examine every use of PAT_STATIC,
so ...



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