Check nativity of all types *before* calling isCompilable

This commit is contained in:
pyos 2018-04-28 01:03:52 +03:00
parent 979c4d959f
commit 5c75342d54

View File

@ -81,12 +81,12 @@ void LLVMContext::finalize()
bool LLVMContext::isCompilable(const IFunctionBase& function) const
{
if (!function.isCompilable() || !toNativeType(shared->builder, function.getReturnType()))
if (!toNativeType(shared->builder, function.getReturnType()))
return false;
for (const auto & type : function.getArgumentTypes())
if (!toNativeType(shared->builder, type))
return false;
return true;
return function.isCompilable();
}
LLVMPreparedFunction::LLVMPreparedFunction(LLVMContext context, std::shared_ptr<const IFunctionBase> parent)