Fix double-indirect p/invoke call generation
authorBruce Forstall <brucefo@microsoft.com>
Fri, 11 Aug 2017 22:15:29 +0000 (15:15 -0700)
committerBruce Forstall <brucefo@microsoft.com>
Fri, 11 Aug 2017 22:15:29 +0000 (15:15 -0700)
commit0e95a6d24f5e29a4d4618ee9a9966999a3361f0e
tree20da7287b1b09767681cb65092931acaeaf42e11
parent43aa882dfddf7757196eea114dce220c7bedbbae
Fix double-indirect p/invoke call generation

When the signature to getAddressOfPInvokeTarget() was changed,
the double-indirect CT_USER_FUNC case was accidentally changed
to pass a non-null `addr` to emitIns_Call(). This leads to asserts
when ngen'ing (in my test, ngen of System.dll on desktop using `LEGACY_BACKEND`
cross-compiling arm32 altjit). For some reason, x86 is more permissive
in the emitIns_Call() assert for this case, but doesn't use the
non-null addr.

Fixes VSO 478352

Commit migrated from https://github.com/dotnet/coreclr/commit/16cc3235d9d389c354efdf4b08421dc1c67d587a
src/coreclr/src/jit/codegenlegacy.cpp