made some updates
This commit is contained in:
parent
8d667ec836
commit
84320f00c7
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
8
record.c
8
record.c
@ -32,7 +32,13 @@ void setField(ObjRef arr, int point, ObjRef value){
|
|||||||
if(0 > point || point > getSize(arr)){
|
if(0 > point || point > getSize(arr)){
|
||||||
printf("Index %i out of bounds for length %i\n",point, getSize(arr));
|
printf("Index %i out of bounds for length %i\n",point, getSize(arr));
|
||||||
}
|
}
|
||||||
GET_REFS_PTR(arr)[point] = malloc(28);
|
if(IS_PRIMITIVE(value)){
|
||||||
|
int size = sizeof(*value);
|
||||||
|
GET_REFS_PTR(arr)[point] = malloc(size);
|
||||||
|
}else{
|
||||||
|
int size = sizeof(*value) + (GET_ELEMENT_COUNT(value) * sizeof(void *));
|
||||||
|
GET_REFS_PTR(arr)[point] = malloc(size);
|
||||||
|
}
|
||||||
* (ObjRef *)GET_REFS_PTR(arr)[point]->data = value;
|
* (ObjRef *)GET_REFS_PTR(arr)[point]->data = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user