Skip to content

Conversation

@kg
Copy link
Member

@kg kg commented Sep 12, 2025

A check failure in baseservices\invalid_operations\InvalidOperations revealed that we need to do this, I think. This doesn't fix the test though, something else is wrong with it.

The reason the calli ptr is null is that the stubcontext value is null, so I also updated the interpreter to fail-fast when this happens - it should never be null.

Also adds some interp diagnostics so that if BADCODE() aborts compilation on a method we're dumping, we print the failure reason to the console.

Copilot AI review requested due to automatic review settings September 12, 2025 19:04
@kg kg requested review from BrzVlad and janvorli as code owners September 12, 2025 19:04
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 adds null-checking for function pointers in the CALLI instruction handler within the CoreCLR interpreter. The change ensures that function pointers are validated before use to prevent potential null dereference issues.

Key changes:

  • Add null-check validation for CALLI function pointers before invocation
  • Refactor to use a local variable for the function pointer to avoid redundant LOCAL_VAR calls

@kg
Copy link
Member Author

kg commented Sep 18, 2025

@janvorli I think I addressed your feedback, lmk if you want more changes

kg added 2 commits September 23, 2025 11:49
Maybe fix linux build

Fail fast when INTOP_GETSTUBCONTEXT doesn't have a stub context to get
If InterpDump is active, print to the console when BADCODE() aborts compilation

Address PR feedback

Address feedback

Make InterpreterStub handle being called on threads without a Thread object
@kg kg force-pushed the interp-calli-nullcheck branch from 71275a8 to 7b30f7c Compare September 23, 2025 18:50
@kg kg enabled auto-merge (squash) September 23, 2025 18:55
@kg kg merged commit 0105d79 into dotnet:main Sep 23, 2025
98 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Oct 24, 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.

2 participants