{
TlsData *tls = user_data;
- if (!tls)
+ if (!tls) {
/* Happens during startup */
+ tls->unwind_state.valid = FALSE;
return;
+ }
if (tls->tid != GetCurrentThreadId ()) {
/* Happens on osx because threads are not suspended using signals */
tls->unwind_state.unwind_data [MONO_UNWIND_DATA_JIT_TLS] = mono_native_tls_get_value (mono_jit_tls_id);
tls->unwind_state.unwind_data [MONO_UNWIND_DATA_DOMAIN] = mono_domain_get ();
}
+
+ if (!tls->unwind_state.unwind_data [MONO_UNWIND_DATA_DOMAIN]) {
+ /* Happens during startup */
+ tls->unwind_state.valid = FALSE;
+ return;
+ }
}
#define DEAD_REF ((gpointer)(gssize)0x2a2a2a2a2a2a2a2aULL)
memset (new_reg_locations, 0, sizeof (new_reg_locations));
while (TRUE) {
+ if (!tls->unwind_state.valid)
+ break;
+
memcpy (&ctx, &new_ctx, sizeof (ctx));
for (i = 0; i < MONO_MAX_IREGS; ++i) {
if (!tls)
return;
+ if (!tls->unwind_state.valid)
+ return;
+
for (findex = 0; findex < tls->nframes; findex ++) {
/* Load information saved by the !precise pass */
fi = &tls->frames [findex];