From fde3ba3bb392104f5b094611f8585f2874523eca Mon Sep 17 00:00:00 2001 From: slava Date: Fri, 17 Nov 2006 06:51:29 +0000 Subject: [PATCH] Fix a hang if you do 'clear drop datastack' --- vm/stack.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/vm/stack.c b/vm/stack.c index 62160dd227..d9008beaca 100644 --- a/vm/stack.c +++ b/vm/stack.c @@ -245,7 +245,9 @@ void primitive_from_r(void) void stack_to_vector(CELL bottom, CELL top) { - CELL depth = (top - bottom + CELLS) / CELLS; + F_FIXNUM depth = (F_FIXNUM)(top - bottom + CELLS) / CELLS; + if(depth < 0) + depth = 0; F_ARRAY *a = allot_array_internal(ARRAY_TYPE,depth); memcpy(a + 1,(void*)bottom,depth * CELLS); dpush(tag_object(a));