Skip to content

Fix contract violations for OLE scenario. #114609

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

Merged
merged 6 commits into from
Apr 16, 2025

Conversation

AaronRobinsonMSFT
Copy link
Member

Rework the logic so the FCall doesn't do any
allocations and defers any non-fast scenario
to the slow path.

Fixes #114372

Rework the logic so the FCall doesn't do any
allocations and defers any non-fast scenario
to the slow path.
Copy link
Contributor

Tagging subscribers to this area: @dotnet/interop-contrib
See info in area-owners.md if you want to be subscribed.

@AaronRobinsonMSFT AaronRobinsonMSFT marked this pull request as ready for review April 14, 2025 16:24
@Copilot Copilot AI review requested due to automatic review settings April 14, 2025 16:24
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (1)

src/coreclr/vm/stubhelpers.cpp:194

  • [nitpick] Consider adding a clarifying comment that explains TryGetOleTlsData only retrieves existing TLS data without creating it, to differentiate it clearly from GetOrCreateOleTlsData.
FORCEINLINE static SOleTlsData* TryGetOleTlsData()

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

Comments suppressed due to low confidence (2)

src/coreclr/vm/stubhelpers.cpp:232

  • The removal of the FP state clearing call in the slow path diverges from the previous behavior where FP state was cleared for VB6 compatibility. Verify that this change is intentional and that it does not introduce issues in scenarios requiring FP state clearing.
GetCOMIPFromRCW_ClearFP();

src/coreclr/vm/olecontexthelpers.cpp:37

  • Switching the contract mode from MODE_ANY (with ENTRY_POINT) to MODE_COOPERATIVE may affect call sites that previously relied on a more flexible mode. Confirm that this change is appropriate for all scenarios where SetupOleContext is used.
MODE_COOPERATIVE;

@AaronRobinsonMSFT
Copy link
Member Author

/cc @jkoritzinsky

@AaronRobinsonMSFT AaronRobinsonMSFT merged commit e7baf91 into dotnet:main Apr 16, 2025
93 of 95 checks passed
@AaronRobinsonMSFT AaronRobinsonMSFT deleted the runtime_114372 branch April 16, 2025 17:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Contract violation in SetupOleContext
2 participants