Skip to content

Conversation

@zhangzhuang15
Copy link

@zhangzhuang15 zhangzhuang15 commented Nov 12, 2025

Pull Request Template

Description

Delete rb-tree node and rebalance up to root node, this will bring null pointer dereference at start of loop in delete_fixup function. To solve this problem, I add a guard and a test case.

Type of change

BugFix

Checklist:

  • I ran bellow commands using the latest version of rust nightly.
  • I ran cargo clippy --all -- -D warnings just before my last commit and fixed any issue that was found.
  • I ran cargo fmt just before my last commit.
  • I ran cargo test just before my last commit and all tests passed.
  • I added my algorithm to the corresponding mod.rs file within its own folder, and in any parent folder(s).
  • I added my algorithm to DIRECTORY.md with the correct link.
  • I checked COUNTRIBUTING.md and my code follows its guidelines.

Please make sure that if there is a test that takes too long to run ( > 300ms), you #[ignore] that or
try to optimize your code or make the test easier to run. We have this rule because we have hundreds of
tests to run; If each one of them took 300ms, we would have to wait for a long time.

@codecov-commenter
Copy link

codecov-commenter commented Nov 12, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.58%. Comparing base (7c1542b) to head (5913f5a).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #947      +/-   ##
==========================================
+ Coverage   95.44%   95.58%   +0.14%     
==========================================
  Files         332      332              
  Lines       21496    21516      +20     
==========================================
+ Hits        20516    20566      +50     
+ Misses        980      950      -30     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@zhangzhuang15
Copy link
Author

@imp2002 cargo clippy, this checkpoint, should be improved! It complains code error in many files, but I don't cover these files in my PR.

@zhangzhuang15 zhangzhuang15 deleted the jasonzhang15/fix_rb_tree_null_pointer_dereference branch November 19, 2025 02:28
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