verilator/test_regress
Matthew Ballance e5594e9c6c Fix constifyParamsEdit regression in visit(AstInsideRange*)
The original code called V3Const::constifyParamsEdit() in
V3Width::visit(AstInsideRange*) to fold negative bin bounds
(e.g., NEGATE(100) -> -100) for covergroup bins. Since
constifyParamsEdit uses m_required=true, it errored on any
non-constant expression -- breaking the upstream test
t_constraint_array_index_simple which uses a foreach loop
variable 'i' in an inside constraint expression.

Fix: Remove the unconditional constifyParamsEdit calls from
V3Width::visit(AstInsideRange*). Instead:
- In V3Width: when m_vup is null (covergroup bin context,
  not an expression context), use constifyEdit (m_required=false)
  to fold constant arithmetic before iterating children.
- In V3Covergroup: call constifyEdit at the two sites that
  cast InsideRange bounds to AstConst for bin expansion.

This moves the covergroup-specific concern to the right layer
(V3Covergroup) while keeping V3Width safe for all contexts.

Also update golden files for t_covergroup_trans_3value,
t_covergroup_trans_restart, and t_covergroup_with_sample_args_too_many_bad
whose line numbers shifted by 1 due to the SPDX copyright header
additions in the previous commit.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-05 21:10:48 +00:00
..
t Fix constifyParamsEdit regression in visit(AstInsideRange*) 2026-04-05 21:10:48 +00:00
.gdbinit
.gitignore
CMakeLists.txt Add SPDX copyright identifiers, and get 'reuse' clean. No functional change. 2026-01-26 20:24:34 -05:00
Makefile Internals: make test-diff macOS compatibility fix - again 2026-01-28 11:05:27 +00:00
Makefile_obj Add SPDX copyright identifiers, and get 'reuse' clean. No functional change. 2026-01-26 20:24:34 -05:00
driver.py Tests: Set MallocNanoZone=0 on macOS when using asan 2026-03-22 17:09:02 +00:00
input.vc
input.xsim.vc