Skip to content

Keep the first word-level Verilog parse error - #606

Open
sifferman wants to merge 1 commit into
berkeley-abc:masterfrom
sifferman:wlc-second-parse-error
Open

sifferman wants to merge 1 commit into
berkeley-abc:masterfrom
sifferman:wlc-second-parse-error

Conversation

@sifferman

@sifferman sifferman commented Nov 11, 2026 •

Copy link
Copy Markdown

Hello! Here's a patch for a bug I found.

%read aborts when one line of word-level Verilog produces two parse errors. A single error prints correctly.

Failing test case

// two_parse_errors.v
module two_parse_errors ( output parsed_output ) ;
  assign parsed_output = ! undeclared_operand ;
endmodule
abc -c "%read two_parse_errors.v"

Received

abc: src/base/wlc/wlcReadVer.c:139: Wlc_PrsWriteErrorMessage: Assertion `p->sError[0] == 0' failed.

Expected

two_parse_errors.v (line 3): Name undeclared_operand is used but not declared.

Cause

Wlc_PrsReadName() writes the message that names the bad signal, then returns a null pointer. Five of its six callers in Wlc_PrsFindDefinition() see only the null pointer and write a second message, which the assertion rejected.

Fix

Keep the first message and ignore the second, so the name and line survive. The sixth caller already returns without writing again, and test/issues/wlc_second_parse_error.sh covers both paths.

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.

1 participant