mirror of
https://github.com/verilator/verilator.git
synced 2026-10-06 01:54:01 +02:00
Fix lifetime of expression coverage variable (#7834)
Signed-off-by: Ryszard Rozak <[email protected]>
This commit is contained in:
@@ -824,6 +824,7 @@ class CoverageVisitor final : public VNVisitor {
|
||||
if (pair.second) {
|
||||
varp = new AstVar{fl, VVarType::MODULETEMP, m_exprTempNames.get(frefp),
|
||||
dtypep};
|
||||
varp->lifetime(VLifetime::AUTOMATIC_EXPLICIT);
|
||||
pair.first->second = varp;
|
||||
if (m_ftaskp) {
|
||||
varp->funcLocal(true);
|
||||
|
||||
@@ -13,6 +13,9 @@ module t;
|
||||
if (!x) begin
|
||||
cnt++;
|
||||
end
|
||||
if (!$onehot(x)) begin
|
||||
cnt++;
|
||||
end
|
||||
end
|
||||
join_none
|
||||
endtask
|
||||
@@ -20,7 +23,7 @@ module t;
|
||||
initial begin
|
||||
myTask();
|
||||
#1;
|
||||
if (cnt != 1) $stop;
|
||||
if (cnt != 2) $stop;
|
||||
|
||||
$write("*-* All Finished *-*\n");
|
||||
$finish;
|
||||
|
||||
Reference in New Issue
Block a user