summaryrefslogtreecommitdiff
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
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.
-rw-r--r--src/vm/method.cpp14
-rw-r--r--tests/arm64/Tests.lst2
2 files changed, 10 insertions, 6 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;
}
diff --git a/tests/arm64/Tests.lst b/tests/arm64/Tests.lst
index fd3d4496f9..17d714e989 100644
--- a/tests/arm64/Tests.lst
+++ b/tests/arm64/Tests.lst
@@ -158,7 +158,7 @@ RelativePath=Interop\NativeCallable\NativeCallableTest\NativeCallableTest.cmd
WorkingDir=Interop\NativeCallable\NativeCallableTest
Expected=0
MaxAllowedDurationSeconds=600
-Categories=Pri0;RT;EXPECTED_FAIL;ISSUE_4422;REL_PASS;ASSERT_ONLY
+Categories=Pri0;RT;EXPECTED_PASS
HostStyle=0
[BoolTest.cmd_23]
RelativePath=Interop\PrimitiveMarshalling\Bool\BoolTest\BoolTest.cmd