File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -175,6 +175,26 @@ void FstData::extractVarNames()
175175
176176 while ((h = fstReaderIterateHier (ctx))) {
177177 switch (h->htyp ) {
178+ case FST_HT_SCOPE : {
179+ // Handle tracking for potential union structs with $fork.
180+ if (!detect_union && h->u .scope .typ == FST_ST_VCD_FORK ) {
181+ detect_union = true ;
182+ fork_parent_scope = fst_scope_name;
183+ fork_name = h->u .scope .name ;
184+ fork_vars.clear ();
185+ } else if (detect_union && h->u .scope .typ == FST_ST_VCD_STRUCT ) {
186+ // Signal that a nested $fork can not be a candidate for union struct detection.
187+ log_warning (" Nested $fork '%s' inside $fork '%s'; "
188+ " abandoning union detection for this scope...\n " ,
189+ h->u .scope .name , fork_name.c_str ());
190+ for (auto &v : fork_vars) registerVar (v);
191+ detect_union = false ;
192+ fork_vars.clear ();
193+ }
194+ // Push the scope onto the stack to 'descend' into the hierarchy.
195+ fst_scope_name = fstReaderPushScope (ctx, h->u .scope .name , NULL );
196+ break ;
197+ }
178198 case FST_HT_SCOPE : {
179199 // Handle tracking for potential union structs with $fork.
180200 if (!detect_union && h->u .scope .typ == FST_ST_VCD_FORK ) {
You can’t perform that action at this time.
0 commit comments