Skip to content

[release/9.0] Consider existence of EETypes and metadata for typeof checks#107598

Merged
agocke merged 5 commits intorelease/9.0from
backport/pr-107347-to-release/9.0
Sep 11, 2024
Merged

[release/9.0] Consider existence of EETypes and metadata for typeof checks#107598
agocke merged 5 commits intorelease/9.0from
backport/pr-107347-to-release/9.0

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

@github-actions github-actions bot commented Sep 10, 2024

Backport of #107347 to release/9.0

/cc @MichalStrehovsky

Customer Impact

  • Customer reported
  • Found internally

Under some circumstances, the compiler could assume code under if (someType == typeof(Foo)) is unreachable and optimize it into an infinite loop. This can happen when type Foo was only visible in metadata and not actually used at runtime.

Regression

  • Yes
  • No

Regressed when the optimization was introduced in #103883

Testing

Added targeted test for this situation. This situation is a corner case and difficult to hit.

Risk

Risk is low. This is restricting the number of cases when the optimization kicks in. When running our size validation tooling on half a dozen apps, this change produced no diffs. The new restriction doesn't kick in often.

IMPORTANT: If this backport is for a servicing release, please verify that:

  • The PR target branch is release/X.0-staging, not release/X.0.

  • If the change touches code that ships in a NuGet package, you have added the necessary package authoring and gotten it explicitly reviewed.

@dotnet-policy-service
Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @agocke, @MichalStrehovsky, @jkotas
See info in area-owners.md if you want to be subscribed.

@MichalStrehovsky MichalStrehovsky added the Servicing-consider Issue for next servicing release review label Sep 10, 2024
@teo-tsirpanis teo-tsirpanis added this to the 9.0.0 milestone Sep 10, 2024
@agocke agocke added Servicing-approved Approved for servicing release and removed Servicing-consider Issue for next servicing release review labels Sep 11, 2024
@agocke agocke merged commit cd064dd into release/9.0 Sep 11, 2024
@agocke agocke deleted the backport/pr-107347-to-release/9.0 branch September 11, 2024 17:04
@github-actions github-actions bot locked and limited conversation to collaborators Oct 12, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-NativeAOT-coreclr Servicing-approved Approved for servicing release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants