mirror of https://gitlab.freedesktop.org/mesa/mesa
ac/nir/llvm: Fix setting function attributes for intrinsics
This fixes a NULL pointer dereference for intrinsics with more than one function attribute introduced in commit2fdaf38
. The fix is ported from the lp_build_intrinsic changes in commit8bdd52c
. Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
This commit is contained in:
parent
74d5d393df
commit
0b98e885e7
|
@ -1675,7 +1675,11 @@ emit_llvm_intrinsic(struct nir_to_llvm_context *ctx, const char *name,
|
|||
LLVMSetFunctionCallConv(function, LLVMCCallConv);
|
||||
LLVMSetLinkage(function, LLVMExternalLinkage);
|
||||
|
||||
ac_add_function_attr(function, 0, attrib_mask | AC_FUNC_ATTR_NOUNWIND);
|
||||
attrib_mask |= AC_FUNC_ATTR_NOUNWIND;
|
||||
while (attrib_mask) {
|
||||
enum ac_func_attr attr = 1u << u_bit_scan(&attrib_mask);
|
||||
ac_add_function_attr(function, -1, attr);
|
||||
}
|
||||
}
|
||||
return LLVMBuildCall(ctx->builder, function, params, param_count, "");
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue