diff --git a/bigint/build/bin/testbip b/bigint/build/bin/testbip index bff0002..d87c3d8 100755 Binary files a/bigint/build/bin/testbip and b/bigint/build/bin/testbip differ diff --git a/bigint/build/lib/libbigint.a b/bigint/build/lib/libbigint.a index 535c3ff..ae6c2bf 100644 Binary files a/bigint/build/lib/libbigint.a and b/bigint/build/lib/libbigint.a differ diff --git a/bigint/src/libbigint.a b/bigint/src/libbigint.a index 535c3ff..ae6c2bf 100644 Binary files a/bigint/src/libbigint.a and b/bigint/src/libbigint.a differ diff --git a/bigint/tst/testbip b/bigint/tst/testbip index bff0002..d87c3d8 100755 Binary files a/bigint/tst/testbip and b/bigint/tst/testbip differ diff --git a/njvm.o b/njvm.o index a5e17be..fbd69b8 100644 Binary files a/njvm.o and b/njvm.o differ diff --git a/record.c b/record.c index ce413b9..2a2e34b 100644 --- a/record.c +++ b/record.c @@ -32,7 +32,13 @@ void setField(ObjRef arr, int point, ObjRef value){ if(0 > point || 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; }