Commit 758939da authored by John's avatar John

fix bug in copy_string_to_graph, adjust n_free_words when copying pointers in...

fix bug in copy_string_to_graph, adjust n_free_words when copying pointers in an array (memory is allocated on the stack AND the heap)
parent d6b7ee87
......@@ -180,9 +180,15 @@ Int *copy_string_to_graph (Int *string_p,void *begin_free_heap,void *end_free_he
heap_p[1]=array_size;
heap_p[2]=elem_desc;
heap_p+=3;
if (elem_desc==0){
Int i;
n_free_words-=array_size;
if (n_free_words<0){
*last_heap_pa=heap_p+array_size+(stack_end-stack_begin);
return (Int*)((Int)string_p+1);
}
stack_p-=array_size;
if (stack_p<stack_begin){
......@@ -273,6 +279,12 @@ Int *copy_string_to_graph (Int *string_p,void *begin_free_heap,void *end_free_he
array_size*=field_size;
n_free_words-=array_size;
if (n_free_words<0){
*last_heap_pa=heap_p+array_size+(stack_end-stack_begin);
return (Int*)((Int)string_p+1);
}
stack_p-=array_size;
if (stack_p<stack_begin){
Int extra_words;
......
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