]> git.ipfire.org Git - thirdparty/gcc.git/commit
libstdc++/regex: Zero-initialize _ExecutorFrame flags
authorPatrick Palka <ppalka@redhat.com>
Mon, 2 Feb 2026 20:14:20 +0000 (15:14 -0500)
committerPatrick Palka <ppalka@redhat.com>
Mon, 2 Feb 2026 20:14:20 +0000 (15:14 -0500)
commit8978da072f9ea7653416d59167a07e79be6cadaf
treec73837b94e8eb47f2d30bedb36f6b44fde750709
parentdda809f25ee115af1566a44340d7570f2bde09d8
libstdc++/regex: Zero-initialize _ExecutorFrame flags

Prevents uninitialized read bugs, and it's also just natural to assume
flags are initially cleared rather than uninitialized.

In passing rename the _M_end flag to _M_subexpr_end to make it distinct
from _Executor::_M_end.

libstdc++-v3/ChangeLog:

* include/bits/regex_executor.tcc (_ExecutorFrameBase):
Zero-initialize _M_byte0.
(_ExecutorFrameBase::_M_end): Rename to ...
(_ExecutorFrameBase::_M_subexpr_end): ... this.
(_Executor::_M_handle_subexpr_begin): Remove now redundant
clearing of _M_subexpr_end.
(_Executor::_M_handle_subexpr_end): Adjust after renaming.
(_Executor::_M_dfs) <case _S_fopcode_restore_cur_results>:
Likewise.

Reviewed-by: Jonathan Wakely <jwakely@redhat.com>
libstdc++-v3/include/bits/regex_executor.tcc