fix: constructing parameterless function descriptors

This commit is contained in:
Vasily Levchenko
2016-10-11 17:45:13 +03:00
parent 937e721d56
commit 6f666b6ca9
@@ -71,7 +71,7 @@ internal fun getLlvmFunctionType(function: FunctionDescriptor): LLVMOpaqueType?
function.valueParameters
val paramTypes = params.map { getLLVMType(it.type) }.toTypedArray()
if (paramTypes.size == 0) return LLVMFunctionType(returnType, null, 0, 0)
val paramTypesPtr = mallocNativeArrayOf(LLVMOpaqueType, *paramTypes)[0] // TODO: dispose
return LLVMFunctionType(returnType, paramTypesPtr, paramTypes.size, 0)
}