On Fri, Aug 21, 2026 at 10:40 AM Tatsuo Ishii <[email protected]> wrote: > > Hi Jian, > > > > > Summary: The code flow in update_reduced_frame, advance_reduced_frame_nfa, > > and > > get_reduced_frame_status is now much more intuitive. Using elog(ERROR) > > prevents > > us from getting stuck in an infinite loop if something goes wrong. > > For me, it's not clear why you add elog(ERROR), rather than Assert. If > the infinite loop should not happen when our program is correct, it > would be better to fix the problem and use Assert. >
Assert will be optimized out in released builds. Using elog(ERROR) can catch such unlikely errors in release builds. Given how recursive the whole patchset is, even with 100% test coverage, I think it would still be better to use elog(ERROR) to guard against some code paths that should not be reached. I also intend to add below at the beginning of nfa_state_free `````` /* state at the free-list head was freed by the previous call */ if (unlikely(winstate->nfaStateFree == state)) elog(ERROR, "double free of RPR NFA state"); `````` -- jian https://www.enterprisedb.com/
