]> gitweb.factorcode.org Git - factor.git/commitdiff
VM: on errors, only dump the heap if it has been initialized
authorBjörn Lindqvist <bjourne@gmail.com>
Tue, 22 Mar 2016 18:33:27 +0000 (19:33 +0100)
committerBjörn Lindqvist <bjourne@gmail.com>
Wed, 23 Mar 2016 00:56:40 +0000 (01:56 +0100)
vm/errors.cpp

index c44574871106893b31a77a7b50543b710a799096..ea74bfc917029bf1a8e36af905d98b28b95970f4 100644 (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();
 }