JIT: Fix gtGetClassHandle with commas (#87313)
authorJakob Botsch Nielsen <Jakob.botsch.nielsen@gmail.com>
Fri, 9 Jun 2023 17:57:46 +0000 (19:57 +0200)
committerGitHub <noreply@github.com>
Fri, 9 Jun 2023 17:57:46 +0000 (19:57 +0200)
commit79fda004ddd21efad928f8739a4783e9dabbfd39
tree4aa93f8afadbfe461f690bbdde63527aa06c699f
parent7de4e1b1d9f102fdbf37c7bc41f47979829422a1
JIT: Fix gtGetClassHandle with commas (#87313)

gtGetClassHandle has comments about "Tunnel through commas", yet several
of the cases then do not actually use the effective value, resulting in
possible asserts when this function is passed a comma.

Fixes an issue I saw in #87265 when morph invokes gtFoldTypeCompare for
the following IR:

```
fgMorphTree BB19, STMT00013 (before)
               [000045] -ACXG------                         *  JTRUE     void
               [000044] -ACXG------                         \--*  NE        int
               [000623] -ACXG------                            +--*  COMMA     ref
               [000622] DA---------                            |  +--*  STORE_LCL_VAR ref    V29 tmp18
               [000621] -----------                            |  |  \--*  LCL_FLD   ref    V07 loc3         [+0]
               [000041] -ACXG------                            |  \--*  CALL nullcheck ref    Microsoft.Extensions.Configuration.Test.ConfigurationProviderTestBase+TestKeyValue:get_AsArray():System.String[]:this
               [000620] -A--------- this                       |     \--*  COMMA     ref
               [000619] DA---------                            |        +--*  STORE_LCL_VAR ref    V30 tmp19
               [000618] -----------                            |        |  \--*  LCL_FLD   ref    V07 loc3         [+8]
               [000617] -----------                            |        \--*  LCL_VAR   ref    V30 tmp19
               [000043] -----------                            \--*  CNS_INT   ref    null
```
src/coreclr/jit/gentree.cpp