Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLudovic Henry <ludovic@xamarin.com>2018-03-23 23:00:39 +0300
committerMarek Safar <marek.safar@gmail.com>2018-03-26 19:01:42 +0300
commitbf27e2544662ab34e1d50f1d43ea96ee2502c685 (patch)
tree8f60a8cd21631973871c6ee3232d8aaa0e052bab
parent4e276971c0c7408a351294d38f857a1322ec3da2 (diff)
Remove suspicious mono_gchandle_freemono-5.10.1.16
Fixes https://github.com/mono/mono/issues/7786
-rw-r--r--mono/metadata/threads.c3
-rw-r--r--mono/utils/mono-threads.c3
2 files changed, 4 insertions, 2 deletions
diff --git a/mono/metadata/threads.c b/mono/metadata/threads.c
index 5bca4f0ab73..e5ab853cd3c 100644
--- a/mono/metadata/threads.c
+++ b/mono/metadata/threads.c
@@ -3008,6 +3008,7 @@ thread_detach (MonoThreadInfo *info)
* the thread */
g_assert (info);
+ g_assert (mono_thread_info_is_current (info));
if (!mono_thread_info_try_get_internal_thread_gchandle (info, &gchandle))
return;
@@ -3015,8 +3016,6 @@ thread_detach (MonoThreadInfo *info)
internal = (MonoInternalThread*) mono_gchandle_get_target (gchandle);
g_assert (internal);
- mono_gchandle_free (gchandle);
-
mono_thread_detach_internal (internal);
}
diff --git a/mono/utils/mono-threads.c b/mono/utils/mono-threads.c
index d41724d7a6f..4e77d0d5582 100644
--- a/mono/utils/mono-threads.c
+++ b/mono/utils/mono-threads.c
@@ -685,6 +685,7 @@ gboolean
mono_thread_info_try_get_internal_thread_gchandle (MonoThreadInfo *info, guint32 *gchandle)
{
g_assert (info);
+ g_assert (mono_thread_info_is_current (info));
if (info->internal_thread_gchandle == G_MAXUINT32)
return FALSE;
@@ -697,6 +698,7 @@ void
mono_thread_info_set_internal_thread_gchandle (MonoThreadInfo *info, guint32 gchandle)
{
g_assert (info);
+ g_assert (mono_thread_info_is_current (info));
g_assert (gchandle != G_MAXUINT32);
info->internal_thread_gchandle = gchandle;
}
@@ -705,6 +707,7 @@ void
mono_thread_info_unset_internal_thread_gchandle (THREAD_INFO_TYPE *info)
{
g_assert (info);
+ g_assert (mono_thread_info_is_current (info));
info->internal_thread_gchandle = G_MAXUINT32;
}