File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -2980,10 +2980,13 @@ Value *ScalarExprEmitter::VisitCastExpr(CastExpr *CE) {
29802980 assert ((DestTy->isConstantMatrixType () || DestTy->isBuiltinType ()) &&
29812981 " Destination type must be a matrix or builtin type." );
29822982 Value *Mat = Visit (E);
2983- auto *MatTy = DestTy->getAs <ConstantMatrixType>();
2983+ unsigned NumCols = 1 ;
2984+ unsigned NumRows = 1 ;
29842985 SmallVector<int > Mask;
2985- unsigned NumCols = MatTy->getNumColumns ();
2986- unsigned NumRows = MatTy->getNumRows ();
2986+ if (auto *MatTy = DestTy->getAs <ConstantMatrixType>()) {
2987+ NumCols = MatTy->getNumColumns ();
2988+ NumRows = MatTy->getNumRows ();
2989+ }
29872990 unsigned ColOffset = NumCols;
29882991 if (auto *SrcMatTy = E->getType ()->getAs <ConstantMatrixType>())
29892992 ColOffset = SrcMatTy->getNumColumns ();
You can’t perform that action at this time.
0 commit comments