VM: on errors, only dump the heap if it has been initialized

locals-and-roots
Björn Lindqvist 2016-03-22 19:33:27 +01:00
parent 6e035c3640
commit 4f33f22b56
1 changed files with 4 additions and 1 deletions

View File

@ -19,7 +19,10 @@ void fatal_error(const char* msg, cell tagged) {
std::cout << "fatal_error: " << msg;
std::cout << ": " << (void*)tagged;
std::cout << std::endl << std::endl;
current_vm()->dump_memory_layout(std::cout);
factor_vm* vm = current_vm();
if (vm->data) {
vm->dump_memory_layout(std::cout);
}
abort();
}