Commit 7285c2ff authored by Laszlo Domoszlai's avatar Laszlo Domoszlai
Browse files

fix bug

parent 4ac88b5e
......@@ -364,14 +364,19 @@ void exec(Code* expr, int frame_ptr, int root_frame_ptr)
Thunk* thunk = get_dst(root_frame_ptr);
int newsize = slice->thunk_size;
if (thunk != NULL && thunk->desc->thunk_size < newsize) {
if (thunk == NULL)
{
thunk = (Thunk*) alloc_heap(newsize);
set_return(root_frame_ptr, thunk);
}
else if (thunk->desc->thunk_size < newsize) {
Thunk* target = thunk;
thunk = (Thunk*) alloc_heap(newsize);
target->desc = (Desc*) __FORWARD_PTR__;
target->_forward_ptr = thunk;
set_return(root_frame_ptr, thunk);
}
thunk->desc = slice;
assert(thunk->desc->arity == (*bt)->desc->arity + expr->nr_args);
......
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