Interop/Runtime: properly initialize ffi_type for structs

This commit is contained in:
Svyatoslav Scherbina
2016-10-14 15:07:52 +03:00
parent b4db26f846
commit bd449b2ac3
@@ -101,6 +101,8 @@ JNIEXPORT jlong JNICALL Java_kotlin_1native_interop_CallbacksKt_ffiTypePointer(J
JNIEXPORT jlong JNICALL Java_kotlin_1native_interop_CallbacksKt_ffiTypeStruct0(JNIEnv *env, jclass cls, jlong elements) {
ffi_type* res = malloc(sizeof(ffi_type));
if (res != NULL) {
res->size = 0;
res->alignment = 0;
res->elements = (ffi_type**) elements;
res->type = FFI_TYPE_STRUCT;
}