Fix logical condition in ComWrappers.TryGetComInterfaceDispatch#127241
Fix logical condition in ComWrappers.TryGetComInterfaceDispatch#127241elinor-fung wants to merge 1 commit intomainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Fixes an always-true conditional in ComWrappers.TryGetComInterfaceDispatch so the “tagged interface” fallback path is only taken when the COM object’s vtable does not match the known runtime-provided IUnknown / IReferenceTrackerTarget implementations.
Changes:
- Replace
knownQI != A || knownQI != BwithknownQI != A && knownQI != Bto correctly detect “neither matches”. - Prevent unnecessary
QueryInterface(IID_TaggedImpl)+ version checks when the vtable is already recognized.
|
Tagging subscribers to this area: @dotnet/interop-contrib |
🤖 Copilot Code Review — PR #127241Note This review was AI-generated by GitHub Copilot. Holistic AssessmentMotivation: The Approach: Changing Summary: ✅ LGTM. Classic boolean logic bug fix ( Detailed Findings✅ Logic Fix — Correct (flagged by all 3 models)Truth table confirms the fix:
The old ✅ Impact Assessment — Performance-Only, No Correctness Risk (flagged by all 3 models)The bug caused unnecessary work on every call across all 3 call sites (
Since the fallback path still returned the correct ✅ Cross-Codebase Scan — No Sibling Issues (flagged by all 3 models)
💡 Regression Test — Optional Follow-Up (flagged by all 3 models)A test verifying that standard managed wrappers take the fast path (no Models contributing: Claude Opus 4.6 (primary), GPT-5.3-Codex, Claude Sonnet 4.5
|
No description provided.