Skip to content

checker: disallow assigning nil to internal type struct fields - #18725

Merged
spytheman merged 2 commits into
vlang:masterfrom
Delta456:disallow_assign_nil
Jul 2, 2023
Merged

spytheman merged 2 commits into
vlang:masterfrom
Delta456:disallow_assign_nil

Conversation

@Delta456

@Delta456 Delta456 commented Jul 1, 2023 •

Copy link
Copy Markdown
Member

Closes #18719

πŸ€– Generated by Copilot at 259f65b

Add a check for assigning nil to struct fields with internal types and a test for it. This prevents potential memory corruption or undefined behavior.

πŸ€– Generated by Copilot at 259f65b

  • Add a check for assigning nil to struct fields with internal types (link)
  • Add a test source file for the new check (link)
  • Add a test output file for the new check (link)

@Delta456
Delta456 marked this pull request as draft July 1, 2023 06:27
@Delta456
Delta456 marked this pull request as ready for review July 1, 2023 07:34
@Delta456
Delta456 requested a review from spytheman July 1, 2023 15:31
@Delta456
Delta456 force-pushed the disallow_assign_nil branch from 05453c3 to 0c63a7a Compare July 2, 2023 09:36

@spytheman spytheman left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Good work.

@spytheman
spytheman merged commit 0ce3e46 into vlang:master Jul 2, 2023
@Delta456
Delta456 deleted the disallow_assign_nil branch July 2, 2023 11:04
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.

Assigning nil to string field should be forbidden due to TCC failure on Windows and Linux

2 participants