Fix more prof_tdata resurrection corner cases.

This commit is contained in:
Jason Evans
2012-04-28 23:27:13 -07:00
parent 0050a0f7e6
commit f278994029
2 changed files with 9 additions and 7 deletions

View File

@@ -440,7 +440,7 @@ prof_lookup(prof_bt_t *bt)
cassert(config_prof);
prof_tdata = prof_tdata_get();
if (prof_tdata == NULL)
if ((uintptr_t)prof_tdata <= (uintptr_t)PROF_TDATA_STATE_MAX)
return (NULL);
if (ckh_search(&prof_tdata->bt2cnt, bt, NULL, &ret.v)) {
@@ -846,7 +846,7 @@ prof_dump(bool propagate_err, const char *filename, bool leakcheck)
cassert(config_prof);
prof_tdata = prof_tdata_get();
if (prof_tdata == NULL)
if ((uintptr_t)prof_tdata <= (uintptr_t)PROF_TDATA_STATE_MAX)
return (true);
prof_enter(prof_tdata);
prof_dump_fd = creat(filename, 0644);