Commit 562cb8de authored by Laszlo Domoszlai's avatar Laszlo Domoszlai
Browse files

fix print thunk bug (interference with the GC)

parent 320df7af
......@@ -101,13 +101,19 @@ void print(bool force) {
} else {
int arity = printDesc(thunk->desc);
// Put the arguments on the stack before any "eval", otherwise GC
// may screws up the pointers
for (int i = 0; i < arity; i++) {
push_a(thunk->_args[arity-i-1]);
}
for (int i = 0; i < arity; i++) {
printf(" ");
push_a(thunk->_args[i]);
if (force) thunk->_args[i]->desc->eval();
if (force) peek_a()->desc->eval();
print(force);
}
}
printf("]");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment