Make the loading of llvm EH info async safe. (#4725)
[mono.git] / mono / mini / mini-exceptions.c
index cacc74c49bc360f876d124fc3fa8a851b479dea7..45ceb0d6629df7c7f288e115d55daf5bd90d3a30 100644 (file)
@@ -2995,7 +2995,12 @@ mono_restore_context (MonoContext *ctx)
 guint8*
 mono_jinfo_get_unwind_info (MonoJitInfo *ji, guint32 *unwind_info_len)
 {
-       if (ji->from_aot)
+       if (ji->has_unwind_info) {
+               /* The address/length in the MonoJitInfo structure itself */
+               MonoUnwindJitInfo *info = mono_jit_info_get_unwind_info (ji);
+               *unwind_info_len = info->unw_info_len;
+               return info->unw_info;
+       } else if (ji->from_aot)
                return mono_aot_get_unwind_info (ji, unwind_info_len);
        else
                return mono_get_cached_unwind_info (ji->unwind_info, unwind_info_len);