errors.cpp: Patch looked like it would work. It either exposes more gc bugs or is incorrect.

Revert "errors.cpp: general_error() throws away its args when it calls compact_gc() when compiled with DEBUG=1. Save the args as data_roots instead. Fixes #615. See #620."

This reverts commit dc46297050.
db4
Doug Coleman 2012-08-15 17:25:14 -07:00
parent beb202b3de
commit 7e39d7ef30
1 changed files with 4 additions and 7 deletions

View File

@ -41,7 +41,7 @@ void out_of_memory()
abort(); abort();
} }
void factor_vm::general_error(vm_error_type error, cell arg1_, cell arg2_) void factor_vm::general_error(vm_error_type error, cell arg1, cell arg2)
{ {
faulting_p = true; faulting_p = true;
@ -50,9 +50,6 @@ void factor_vm::general_error(vm_error_type error, cell arg1_, cell arg2_)
bignum_roots.clear(); bignum_roots.clear();
code_roots.clear(); code_roots.clear();
data_root<object> arg1(arg1_,this);
data_root<object> arg2(arg2_,this);
/* If we had an underflow or overflow, data or retain stack /* If we had an underflow or overflow, data or retain stack
pointers might be out of bounds, so fix them before allocating pointers might be out of bounds, so fix them before allocating
anything */ anything */
@ -72,7 +69,7 @@ void factor_vm::general_error(vm_error_type error, cell arg1_, cell arg2_)
/* Now its safe to allocate and GC */ /* Now its safe to allocate and GC */
cell error_object = allot_array_4(special_objects[OBJ_ERROR], cell error_object = allot_array_4(special_objects[OBJ_ERROR],
tag_fixnum(error),arg1.value(),arg2.value()); tag_fixnum(error),arg1,arg2);
ctx->push(error_object); ctx->push(error_object);
@ -87,8 +84,8 @@ void factor_vm::general_error(vm_error_type error, cell arg1_, cell arg2_)
{ {
std::cout << "You have triggered a bug in Factor. Please report.\n"; std::cout << "You have triggered a bug in Factor. Please report.\n";
std::cout << "error: " << error << std::endl; std::cout << "error: " << error << std::endl;
std::cout << "arg 1: "; print_obj(arg1.value()); std::cout << std::endl; std::cout << "arg 1: "; print_obj(arg1); std::cout << std::endl;
std::cout << "arg 2: "; print_obj(arg2.value()); std::cout << std::endl; std::cout << "arg 2: "; print_obj(arg2); std::cout << std::endl;
factorbug(); factorbug();
abort(); abort();
} }