Skip to content

Commit

Permalink
Skip expanding the intrinsic for __Canon
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergio0694 committed Jan 18, 2024
1 parent afde0ce commit eb2b3a9
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/coreclr/jit/importercalls.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3375,6 +3375,13 @@ GenTree* Compiler::impIntrinsic(GenTree* newobjThis,
{
retNode = gtNewTrue();
}
else if ((info.compCompHnd->getClassAttribs(hClass) & CORINFO_FLG_SHAREDINST) != 0)
{
// if we have no type arguments, check that the type itself is not __Canon, and
// simply skip expanding the intrinsic in that case, rather than incorrectly
// hardcoding 'false' as the resulting expression.
retNode = nullptr;
}
else
{
retNode = gtNewFalse();
Expand Down

0 comments on commit eb2b3a9

Please sign in to comment.