diff --git a/mps/code/event.c b/mps/code/event.c index 1bdbafb34f6..96e78b24061 100644 --- a/mps/code/event.c +++ b/mps/code/event.c @@ -404,6 +404,13 @@ void EventDump(mps_lib_FILE *stream) AVER(stream != NULL); + /* This can happen if there's a backtrace very early in the life of + the MPS, and will cause an access violation if we continue. */ + if (!eventInited) { + WriteF(stream, "No events\n", NULL); + return; + } + for (kind = 0; kind < EventKindLIMIT; ++kind) { for (event = (Event)EventLast[kind]; event < (Event)(EventBuffer[kind] + EventBufferSIZE);