Skip to content

[mono][interp] Add missing intrinsic for Volatile.ReadBarrier/WriteBarrier#124538

Merged
BrzVlad merged 1 commit intodotnet:mainfrom
BrzVlad:fix-interp-barrier
Feb 18, 2026
Merged

[mono][interp] Add missing intrinsic for Volatile.ReadBarrier/WriteBarrier#124538
BrzVlad merged 1 commit intodotnet:mainfrom
BrzVlad:fix-interp-barrier

Conversation

@BrzVlad
Copy link
Member

@BrzVlad BrzVlad commented Feb 18, 2026

For simplicity, this just adds full memory barriers. Previously, calling this code would lead to stack overflow due to recursively calling itself.

…rrier

For simplicity, this just adds full memory barriers. Previously, calling this code would lead to stack overflow due to recursively calling itself.
@dotnet-policy-service
Copy link
Contributor

Tagging subscribers to this area: @vitek-karas, @BrzVlad, @kotlarmilos
See info in area-owners.md if you want to be subscribed.

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.

Pull request overview

This PR updates Mono’s interpreter intrinsic handling to recognize System.Threading.Volatile.ReadBarrier and System.Threading.Volatile.WriteBarrier, preventing infinite recursion/stack overflow when these [Intrinsic] stub methods are executed under the interpreter.

Changes:

  • Add interpreter intrinsic mapping for Volatile.ReadBarrier() and Volatile.WriteBarrier().
  • Implement the intrinsic by emitting an existing interpreter memory-barrier opcode.

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.

3 participants