mirror of
https://github.com/steveicarus/iverilog.git
synced 2026-09-07 19:56:53 +02:00
NetEvWait: Don't delete event in destructor
`NetEvWait` deletes the event that is assigned to it when itself is deleted. But the event is not owned by the `NetEvWait`, it is shared among all consumers of the event. Deleting it when the `NetEvWait` is deleted can result in undefined behavior. This is mainly a problem for non-blocking event control assignments with a zero or negative immediate valued repeat. In this case the `NetEvWait` will be deleted as it is not needed. ``` reg x; event e; x <= repeat(1) @e 1'b0; x <= repeat(0) @e 1'b1; // Assert triggered since in-use event is freed ``` Remove the delete to fix this. Events that end up being unused will be freed by the nodangle functor. Signed-off-by: Lars-Peter Clausen <[email protected]>
This commit is contained in:
@@ -407,7 +407,6 @@ NetEvWait::~NetEvWait()
|
||||
tmp->next = tmp->next->next;
|
||||
delete tmp;
|
||||
}
|
||||
delete tgt;
|
||||
}
|
||||
events_.clear();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user