Skip to content

Fix contract violations for OLE scenario.#114609

Merged
AaronRobinsonMSFT merged 6 commits intodotnet:mainfrom
AaronRobinsonMSFT:runtime_114372
Apr 16, 2025
Merged

Fix contract violations for OLE scenario.#114609
AaronRobinsonMSFT merged 6 commits intodotnet:mainfrom
AaronRobinsonMSFT:runtime_114372

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.
@dotnet-policy-service
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 AI review requested due to automatic review settings April 14, 2025 16:24
Copy link
Contributor

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 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
@github-actions github-actions bot locked and limited conversation to collaborators May 17, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Contract violation in SetupOleContext

3 participants