Verified Commit 76274a29 authored by Camil Staps's avatar Camil Staps 🚀

Avoid new GCC warning "array subscript -1 is outside array bounds"

parent 4a5963eb
Pipeline #48250 passed with stages
in 9 minutes and 48 seconds
......@@ -365,12 +365,12 @@ BC_WORD *garbage_collect(BC_WORD *stack, BC_WORD *asp,
# if DEBUG_GARBAGE_COLLECTOR > 1
EPRINTF ("Clean up shared nodes array...\n");
# endif
extern BC_WORD __Nil;
extern void *__Nil;
for (int host_nodeid=(BC_WORD)shared_nodes_of_host[-2]-1; host_nodeid>=0; host_nodeid--) {
if ((BC_WORD)shared_nodes_of_host[host_nodeid]&1)
shared_nodes_of_host[host_nodeid]=(BC_WORD*)((BC_WORD)shared_nodes_of_host[host_nodeid]-1);
else
shared_nodes_of_host[host_nodeid]=&__Nil-1;
shared_nodes_of_host[host_nodeid]=(BC_WORD*)(&__Nil-1);
}
ie->hp_end=new.end;
......
......@@ -28,8 +28,8 @@ INSTRUCTION_BLOCK(jsr_eval_host_node):
ie->hp=hp;
}
extern BC_WORD __Nil;
ie->host->clean_ie->__ie_2->__ie_shared_nodes[3+host_nodeid]=&__Nil-1;
extern void *__Nil;
ie->host->clean_ie->__ie_2->__ie_shared_nodes[3+host_nodeid]=(BC_WORD*)(&__Nil-1);
BC_WORD *new_n;
int words_used=copy_to_interpreter_or_garbage_collect(ie, &new_n, host_node);
......
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