Merge pull request dotnet/coreclr#22731 from briansull/issue-22436

Fix Issue 22436 - noway_assert  'expTyp == cseLclVarTyp' in optcse.cpp

Commit migrated from https://github.com/dotnet/coreclr/commit/bb0c2df97117060ad21371cfe71fb27e727cd27c
This commit is contained in:
Brian Sullivan authored and GitHub committed 2019-02-21 15:37:55 -08:00
commit a564d70dfd
2 files changed
+30 -19

No files matched your search

+30 -1
View File
@@ -1971,6 +1971,32 @@ public:
return result;
}
// IsCompatibleType() takes two var_types and returns true if they
// are compatible types for CSE substitution
//
bool IsCompatibleType(var_types cseLclVarTyp, var_types expTyp)
{
// Exact type match is the expected case
if (cseLclVarTyp == expTyp)
{
return true;
}
// We also allow TYP_BYREF and TYP_I_IMPL as compatible types
//
if ((cseLclVarTyp == TYP_BYREF) && (expTyp == TYP_I_IMPL))
{
return true;
}
if ((cseLclVarTyp == TYP_I_IMPL) && (expTyp == TYP_BYREF))
{
return true;
}
// Otherwise we have incompatible types
return false;
}
// PerformCSE() takes a successful candidate and performs the appropriate replacements:
//
// It will replace all of the CSE defs with assignments to a new "cse0" LclVar
@@ -2105,7 +2131,10 @@ public:
/* Figure out the actual type of the value */
var_types expTyp = genActualType(exp->TypeGet());
noway_assert(expTyp == cseLclVarTyp);
// The cseLclVarType must be a compatible with expTyp
//
noway_assert(IsCompatibleType(cseLclVarTyp, expTyp));
// This will contain the replacement tree for exp
// It will either be the CSE def or CSE ref
-18
View File
@@ -255,18 +255,6 @@
<ExcludeList Include="$(XunitTestBinBase)/baseservices/varargs/varargsupport_r/*">
<Issue>Varargs supported on this platform</Issue>
</ExcludeList>
<ExcludeList Include="$(XunitTestBinBase)/Interop/PInvoke/BestFitMapping/Char/AFT_PFT/AFT_PFT/*">
<Issue>22436</Issue>
</ExcludeList>
<ExcludeList Include="$(XunitTestBinBase)/Interop/PInvoke/BestFitMapping/Char/Assembly_False_False/Assembly_False_False/*">
<Issue>22436</Issue>
</ExcludeList>
<ExcludeList Include="$(XunitTestBinBase)/Interop/PInvoke/BestFitMapping/LPStr/AFT_PFT/AFT_PFT/*">
<Issue>22436</Issue>
</ExcludeList>
<ExcludeList Include="$(XunitTestBinBase)/Interop/PInvoke/BestFitMapping/LPStr/Assembly_False_False/Assembly_False_False/*">
<Issue>22436</Issue>
</ExcludeList>
</ItemGroup>
<!-- Windows x86 specific excludes -->
@@ -295,12 +283,6 @@
<ExcludeList Include="$(XunitTestBinBase)/baseservices/varargs/varargsupport_r/*">
<Issue>Varargs supported on this platform</Issue>
</ExcludeList>
<ExcludeList Include="$(XunitTestBinBase)/Interop/PInvoke/BestFitMapping/Char/AFT_PFT/AFT_PFT/*">
<Issue>22436</Issue>
</ExcludeList>
<ExcludeList Include="$(XunitTestBinBase)/Interop/PInvoke/BestFitMapping/LPStr/AFT_PFT/AFT_PFT/*">
<Issue>22436</Issue>
</ExcludeList>
</ItemGroup>
<!-- Windows arm32 specific excludes -->