-
Notifications
You must be signed in to change notification settings - Fork 522
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
[RGen] Fix an issue with the GC.KeepAlive analyzer. #22463
Conversation
The analyzer returns a lot of false positives for a very common usage pattern in the generated code: ```csharp if (foo) { XMethod (x.Handle); } else { YMethod (x.Handle); } GC.KeepAlive (x); ``` This change takes into account this pattern and ignores those false positives. The code is not a general solution, it just accounts for a very well known pattern.
✅ [CI Build #a5c1fc8] Build passed (Build packages) ✅Pipeline on Agent |
✅ [PR Build #a5c1fc8] Build passed (Detect API changes) ✅Pipeline on Agent |
✅ [CI Build #a5c1fc8] Build passed (Build macOS tests) ✅Pipeline on Agent |
💻 [CI Build #a5c1fc8] Tests on macOS M1 - Mac Monterey (12) passed 💻✅ All tests on macOS M1 - Mac Monterey (12) passed. Pipeline on Agent |
💻 [CI Build #a5c1fc8] Tests on macOS X64 - Mac Sonoma (14) passed 💻✅ All tests on macOS X64 - Mac Sonoma (14) passed. Pipeline on Agent |
💻 [CI Build #a5c1fc8] Tests on macOS arm64 - Mac Sequoia (15) passed 💻✅ All tests on macOS arm64 - Mac Sequoia (15) passed. Pipeline on Agent |
💻 [CI Build #a5c1fc8] Tests on macOS M1 - Mac Ventura (13) passed 💻✅ All tests on macOS M1 - Mac Ventura (13) passed. Pipeline on Agent |
✅ API diff for current PR / commit.NET ( No breaking changes )❗ API diff vs stable (Breaking changes).NET ( ❗ Breaking changes ❗ )ℹ️ Generator diffGenerator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes) Pipeline on Agent |
🔥 [CI Build #a5c1fc8] Test results 🔥Test results❌ Tests failed on VSTS: test results 0 tests crashed, 2 tests failed, 115 tests passed. Failures❌ linker tests
Html Report (VSDrops) Download ❌ monotouch tests (macOS)
Html Report (VSDrops) Download Successes✅ cecil: All 1 tests passed. Html Report (VSDrops) Download Pipeline on Agent |
Failures are unrelated to the change. |
The analyzer returns a lot of false positives for a very common usage pattern in the generated code:
This change takes into account this pattern and ignores those false positives. The code is not a general solution, it just accounts for a very well known pattern.