forked from OSchip/llvm-project
CGBuiltin - Use castAs<> instead of getAs<> to avoid dereference of nullptr
The pointer is always dereferenced immediately below, so assert the cast is correct instead of returning nullptr
This commit is contained in:
parent
dcc20143e1
commit
497a4b26c4
|
@ -3223,7 +3223,7 @@ RValue CodeGenFunction::EmitBuiltinExpr(const GlobalDecl GD, unsigned BuiltinID,
|
|||
*this, E, llvm::Intrinsic::vector_reduce_xor, "rdx.xor"));
|
||||
|
||||
case Builtin::BI__builtin_matrix_transpose: {
|
||||
const auto *MatrixTy = E->getArg(0)->getType()->getAs<ConstantMatrixType>();
|
||||
auto *MatrixTy = E->getArg(0)->getType()->castAs<ConstantMatrixType>();
|
||||
Value *MatValue = EmitScalarExpr(E->getArg(0));
|
||||
MatrixBuilder<CGBuilderTy> MB(Builder);
|
||||
Value *Result = MB.CreateMatrixTranspose(MatValue, MatrixTy->getNumRows(),
|
||||
|
|
Loading…
Reference in New Issue