mirror of
https://github.com/justinethier/cyclone.git
synced 2025-05-23 20:15:05 +02:00
Initialize elts member during heap allocation
This commit is contained in:
parent
137305bbc9
commit
1664e20d4c
1 changed files with 2 additions and 0 deletions
|
@ -2480,6 +2480,7 @@ char *gc_move(char *obj, gc_thread_data *thd, int *alloci, int *heap_grown) {
|
|||
hobj->fn = ((closureN) obj)->fn;
|
||||
hobj->num_args = ((closureN) obj)->num_args;
|
||||
hobj->num_elt = ((closureN) obj)-> num_elt;
|
||||
hobj->elts = (object *)(((char *)hobj) + sizeof(closureN_type));
|
||||
for (i = 0; i < hobj->num_elt; i++) {
|
||||
hobj->elts[i] = ((closureN) obj)->elts[i];
|
||||
}
|
||||
|
@ -2496,6 +2497,7 @@ char *gc_move(char *obj, gc_thread_data *thd, int *alloci, int *heap_grown) {
|
|||
mark(hobj) = 0;
|
||||
type_of(hobj) = vector_tag;
|
||||
hobj->num_elt = ((vector) obj)-> num_elt;
|
||||
hobj->elts = (object *)(((char *)hobj) + sizeof(vector_type));
|
||||
for (i = 0; i < hobj->num_elt; i++) {
|
||||
hobj->elts[i] = ((vector) obj)->elts[i];
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue