diff options
author | github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> | 2022-05-24 18:37:26 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-24 18:37:26 +0300 |
commit | 6c7e72dd8e0a0986f197d1bb23f623a70ad87396 (patch) | |
tree | 87f92987324c44add97091f563aed4b8c409411a | |
parent | dffa5ab92245f2419238a35b7c2052e9a24036b4 (diff) |
[mono] Fix a crash during stack trace construction if a this object is null. (#21488)
Fixes dotnet#67354.
Co-authored-by: Bill Holmes <bill.holmes@unity3d.com>
-rw-r--r-- | mono/mini/mini-exceptions.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/mono/mini/mini-exceptions.c b/mono/mini/mini-exceptions.c index e712a623bb4..91990adbf59 100644 --- a/mono/mini/mini-exceptions.c +++ b/mono/mini/mini-exceptions.c @@ -840,7 +840,7 @@ get_generic_info_from_stack_frame (MonoJitInfo *ji, MonoContext *ctx) /* Avoid returning a managed object */ MonoObject *this_obj = (MonoObject *)info; - return this_obj->vtable; + return this_obj ? this_obj->vtable : NULL; } } @@ -901,7 +901,7 @@ get_method_from_stack_frame (MonoJitInfo *ji, gpointer generic_info) MonoGenericContext context; MonoMethod *method; - if (!ji->has_generic_jit_info || !mono_jit_info_get_generic_jit_info (ji)->has_this) + if (!ji->has_generic_jit_info || !mono_jit_info_get_generic_jit_info (ji)->has_this || !generic_info) return jinfo_get_method (ji); context = mono_get_generic_context_from_stack_frame (ji, generic_info); |