diff options
author | Steve MacLean <sdmaclea.qdt@qualcommdatacenter.com> | 2018-04-23 21:39:24 -0400 |
---|---|---|
committer | Jan Kotas <jkotas@microsoft.com> | 2018-04-23 18:39:24 -0700 |
commit | 5ebaadf50f99050591a6a987888ef9077cf2050b (patch) | |
tree | 56b041ce3ebb132089b47cfda93b8013b19021f6 /src/vm/dllimport.cpp | |
parent | 8c4a47196b18531ae387c289888f64f405bf2b29 (diff) | |
download | coreclr-5ebaadf50f99050591a6a987888ef9077cf2050b.tar.gz coreclr-5ebaadf50f99050591a6a987888ef9077cf2050b.tar.bz2 coreclr-5ebaadf50f99050591a6a987888ef9077cf2050b.zip |
GenericPInvokeCalli shift left then or 1 (#17734)
When _WIN64 is defined vm relies on the secret arg being
shifted left and orred with #1.
Revert part of changes from #17659 to fix dotnet/corefx#29266
Fix arm64 to match amd64
Simplify dllimport.cpp
Diffstat (limited to 'src/vm/dllimport.cpp')
-rw-r--r-- | src/vm/dllimport.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/vm/dllimport.cpp b/src/vm/dllimport.cpp index c0f7d1fa24..dc5ae06bf2 100644 --- a/src/vm/dllimport.cpp +++ b/src/vm/dllimport.cpp @@ -2256,6 +2256,11 @@ void NDirectStubLinker::DoNDirect(ILCodeStream *pcsEmit, DWORD dwStubFlags, Meth // for managed-to-unmanaged CALLI that requires marshaling, the target is passed // as the secret argument to the stub by GenericPInvokeCalliHelper (asmhelpers.asm) EmitLoadStubContext(pcsEmit, dwStubFlags); +#ifdef _WIN64 + // the secret arg has been shifted to left and ORed with 1 (see code:GenericPInvokeCalliHelper) + pcsEmit->EmitLDC(1); + pcsEmit->EmitSHR_UN(); +#endif } else #ifdef FEATURE_COMINTEROP |