Fix segfault in fork synchronization (#5906).

This commit is contained in:
Wilson Snyder 2025-04-04 08:15:39 -04:00
parent 73d52c00bb
commit 6ba06498db
2 changed files with 3 additions and 2 deletions

View File

@ -66,6 +66,7 @@ Verilator 5.035 devel
* Fix process comparisons (#5896).
* Fix ccache with clang (#5899). [Geza Lore]
* Fix delayed assignment malformed LHS assertion (#5904).
* Fix segfault in fork synchronization (#5906). [Krzysztof Bieganski, Antmicro Ltd.]
* Fix `new this` (#5909).

View File

@ -723,8 +723,8 @@ class TimingControlVisitor final : public VNVisitor {
void makeForkJoin(AstFork* const forkp) {
// Create a fork sync var
FileLine* const flp = forkp->fileline();
// If we're in a function, insert the sync var directly before the fork
AstNode* const insertBeforep = m_classp ? forkp : nullptr;
// Insert the sync var directly before the fork
AstNode* const insertBeforep = forkp;
addCLocalScope(flp, insertBeforep);
AstVarScope* forkVscp
= createTemp(flp, forkp->name() + "__sync", getCreateForkSyncDTypep(), insertBeforep);