JIT: fix assert when there are mixed types in Enum.HasFlags optimization (#23902)
authorAndy Ayers <andya@microsoft.com>
Thu, 11 Apr 2019 23:45:30 +0000 (16:45 -0700)
committerGitHub <noreply@github.com>
Thu, 11 Apr 2019 23:45:30 +0000 (16:45 -0700)
commit759e3777aad6e711c6c6171ee738df9f38e877a0
tree72a55e59d675d726ac9f762d617b662591a724a5
parentbf20ae796436e04a6c2f13231fee54468c524688
JIT: fix assert when there are mixed types in Enum.HasFlags optimization (#23902)

In some cases the pre-boxed nodes may differ in type. Bail if they don't have
the same stack type, then compute the result using the stack type.

Extended the hasflags test with a case that shows this issue.

Closes #23847
src/jit/gentree.cpp
tests/src/JIT/opt/Enum/hasflag.cs
tests/src/JIT/opt/Enum/hasflag.csproj