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:
authorJoshua Peterson <joshuap@unity3d.com>2022-01-24 17:16:03 +0300
committerGitHub <noreply@github.com>2022-01-24 17:16:03 +0300
commit95229aaa2ec642449aea4eba44fc717ca74786ab (patch)
treede925a953d07b40ad371672cd0592f62c6ce9e81
parentaa2e05a8d4b9e8cd16a76704a73419bab5dce0c3 (diff)
Add missing handle function enter/return macros (#21405)
The mono_field_static_get_value method uses a handle, but did not set up enter/exit macros properly, so this handle was leaked. Some code in Unity calls this embedding API method pretty often, which can lead to the mark stack overflowing in the GC code.
-rw-r--r--mono/metadata/object.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/mono/metadata/object.c b/mono/metadata/object.c
index 4052ce7fa03..fb01a31cb5b 100644
--- a/mono/metadata/object.c
+++ b/mono/metadata/object.c
@@ -3895,9 +3895,13 @@ mono_field_static_get_value (MonoVTable *vt, MonoClassField *field, void *value)
{
MONO_REQ_GC_NEUTRAL_MODE;
+ HANDLE_FUNCTION_ENTER ();
+
ERROR_DECL (error);
mono_field_static_get_value_checked (vt, field, value, MONO_HANDLE_NEW (MonoString, NULL), error);
mono_error_cleanup (error);
+
+ HANDLE_FUNCTION_RETURN ();
}
/**