This function is called from mini-gc.c when a collection is triggered,
which can happen before any managed call is executed by the thread.
At least the allocation of the thread object happens in unmanaged code.
if ((jit_tls = TlsGetValue (mono_jit_tls_id)))
return jit_tls->lmf;
-
- g_assert_not_reached ();
+ /*
+ * We do not assert here because this function can be called from
+ * mini-gc.c on a thread that has not executed any managed code, yet
+ * (the thread object allocation can trigger a collection).
+ */
return NULL;
#endif
}