verilator/test_regress
Marco Brambilla 1f164d7ee0
Fix wait fork trigger temporary split across generated functions (#7985) (#7986)
splitCheck() cuts a function's top level statement list on node count
alone, ignoring AstVar declarations in that list. localizeVars() puts the
dynamic trigger temporaries there, which a 'wait fork' reaches, so the
declaration could land in one sub-function and its references in another.
Sub-functions are emitted as separate C++ functions, so the output failed
to compile:

    error: '__Vtrigprevexpr_h5d9da2ce__0' was not declared in this scope

V3InlineCFuncs could also inline the sub-function holding the declaration
and free the AstVar while other sub-functions still referenced it, which
--debug reports as a broken link and which segfaults an -O3 build.

The existing "Can't split function with local variables" assertion only
checked AstCFunc::varsp(), not declarations among the statements.

Only allow a sub-function boundary where it does not separate a local
declaration from a reference to it. This keeps the temporaries function
local, as #6859 requires, while restoring the guarantee #5822 made that
splitting cannot orphan them.

Signed-off-by: Marco Brambilla <marco@hairyotter.com>
2026-08-05 17:33:58 +01:00
..
t Fix wait fork trigger temporary split across generated functions (#7985) (#7986) 2026-08-05 17:33:58 +01:00
.gdbinit
.gitignore
AGENTS.md CI: Autoformat markdown files 2026-06-15 17:44:50 -04:00
CMakeLists.txt Remove multi-threaded FST tracing (#7443) 2026-04-19 16:02:12 +01:00
Makefile Test: Remove old Makefile rules 2026-04-13 21:09:09 -04:00
Makefile_obj
driver.py Tests: Add TSan and failing multi-threaded data race test (#7913) 2026-07-10 14:34:51 +01:00
input.vc
input.xsim.vc
tsan.supp Tests: Add TSan and failing multi-threaded data race test (#7913) 2026-07-10 14:34:51 +01:00