Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[slang-tidy] Fix NoOldAlwaysSyntax checker segmentation fault #882

Conversation

likeamahoney
Copy link
Contributor

@likeamahoney likeamahoney commented Jan 30, 2024

By default LHSSymbol collector from ASTHelpers may store nullptr value when - assignment lhs is not lvalue directy (for example - {x} = 1;) and at another cases. Then it leads to segmentation fault at NoOldAlwaysSyntax checker when stored lhs value is dereferenced.

How to reproduce:

  1. Create an bug.sv file:
module top();
    logic n;
    always @(*) begin
        {n} = 1;
    end
endmodule
  1. Run NoOldAlwaysSyntax checker on it at any build. For example:
./build/gcc-11-release/bin/slang-tidy --config-file="Checks:-*, style-no-old-always-syntax"  bug.sv

@MikePopoloski
Copy link
Owner

Thanks for the PR!

@MikePopoloski MikePopoloski merged commit 3afb0b6 into MikePopoloski:master Jan 30, 2024
17 checks passed
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.

2 participants