Skip to content

Conversation

FlinkbaumFAU
Copy link

The parser crashed when an ifnone-statement occured. See Bug #5092 .

The state_dependen_path_declaration from the specification was added to the parser file.

@FlinkbaumFAU FlinkbaumFAU requested a review from zachjs as a code owner May 14, 2025 19:19
@@ -6,7 +6,7 @@ GENFILES += frontends/verilog/verilog_lexer.cc

frontends/verilog/verilog_parser.tab.cc: frontends/verilog/verilog_parser.y
$(Q) mkdir -p $(dir $@)
$(P) $(BISON) -Wall -Werror -o $@ -d -r all -b frontends/verilog/verilog_parser $<
$(P) $(BISON) -Wall -Wcex -Werror -o $@ -d -r all -b frontends/verilog/verilog_parser $<
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From https://www.gnu.org/software/bison/manual/html_node/Diagnostics.html:

cex
Provide counterexamples for conflicts. See Generation of Counterexamples. Counterexamples take time to compute. The option -Wcex should be used by the developer when working on the grammar; it hardly makes sense to use it in a CI.

I don't think this should be included.

module_path_expression:
module_path_primary
// Flatten out unary_operator to avoid shift/reduce conflict
| '!' attr module_path_primary { delete $2; }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based on the existing code, these need to be freeattr($2); instead to avoid a memory leak (not that I'm sure why they're being deleted).

@KrystalDelusion
Copy link
Member

Also could you please add test(s) for the ifnone parsing? There are some existing tests in tests/various/specify.{v,ys} that you can expand/reference.

@mole99
Copy link

mole99 commented Sep 4, 2025

Hi, I really appreciate this fix. I just ran in the same issue as #5092 when I tried to read in the IHP stdcells as blackboxes.

@FlinkbaumFAU, do you still intend to finish it?

@FlinkbaumFAU
Copy link
Author

Hi,
sorry I have completely forgotten about this pull request, since I had already moved on by creating my own blackboxes with a python script.
I'll try to fix it this week. I suppose there will be others too with the same problem.

@mole99
Copy link

mole99 commented Sep 5, 2025

Thanks a lot! Yes, it's just a matter of time until someone else stumbles across this issue :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants