summaryrefslogtreecommitdiff
path: root/src/vm/method.cpp
diff options
context:
space:
mode:
authorKyungwoo Lee <kyulee@microsoft.com>2016-04-25 11:11:14 -0700
committerKyungwoo Lee <kyulee@microsoft.com>2016-04-25 15:28:28 -0700
commit76ba59032965f745926c788c879df225b9a25649 (patch)
tree8e2e03f6737e9b29711f5ca22094931ad5fc4e4d /src/vm/method.cpp
parent5df671e6fbdaa8c356c9032b03cdb21e2c0e32be (diff)
downloadcoreclr-76ba59032965f745926c788c879df225b9a25649.tar.gz
coreclr-76ba59032965f745926c788c879df225b9a25649.tar.bz2
coreclr-76ba59032965f745926c788c879df225b9a25649.zip
ARM64: Fix NativeCallable
Fixes https://github.com/dotnet/coreclr/issues/4422 The issue is that JIT didn't pass UMEntryThunk for the managed function entry point which is invoked from the native function. The fix is to enable NativeCallable attribute check to get the right entry point.
Diffstat (limited to 'src/vm/method.cpp')
-rw-r--r--src/vm/method.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/vm/method.cpp b/src/vm/method.cpp
index ae98743073..1b7aa5c17e 100644
--- a/src/vm/method.cpp
+++ b/src/vm/method.cpp
@@ -5393,18 +5393,22 @@ BOOL MethodDesc::HasNativeCallableAttribute()
}
CONTRACTL_END;
-// enable only for amd64 now, other platforms are not tested.
-#if defined(_TARGET_AMD64_)
-
#ifdef FEATURE_CORECLR
HRESULT hr = GetMDImport()->GetCustomAttributeByName(GetMemberDef(),
g_NativeCallableAttribute,
NULL,
NULL);
- return (hr == S_OK);
+ if (hr == S_OK)
+ {
+ // enable only for amd64/arm64 now, other platforms are not tested.
+#if defined(_TARGET_AMD64_) || defined(_TARGET_ARM64_)
+ return TRUE;
+#else
+ _ASSERTE(!"HasNativeCallableAttribute is not yet implemented.");
+#endif // _TARGET_AMD64_ || _TARGET_ARM64_
+ }
#endif //FEATURE_CORECLR
-#endif //_TARGET_AMD64_
return FALSE;
}