File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -585,13 +585,13 @@ void Verifier::visitReturnInst(ReturnInst &RI) {
585
585
Assert2 (F->getReturnType () == RI.getOperand (0 )->getType (),
586
586
" Function return type does not match operand "
587
587
" type of return inst!" , &RI, F->getReturnType ());
588
- else {
589
- const StructType *STy = cast<StructType>(F->getReturnType ());
588
+ else if (const StructType *STy = dyn_cast<StructType>(F->getReturnType ())) {
590
589
for (unsigned i = 0 ; i < N; i++)
591
590
Assert2 (STy->getElementType (i) == RI.getOperand (i)->getType (),
592
- " Function return type does not match operand "
593
- " type of return inst!" , &RI, F->getReturnType ());
594
- }
591
+ " Function return type does not match operand "
592
+ " type of return inst!" , &RI, F->getReturnType ());
593
+ } else
594
+ Assert1 (0 , " Invalid return type!" , &RI);
595
595
596
596
// Check to make sure that the return value has necessary properties for
597
597
// terminators...
You can’t perform that action at this time.
0 commit comments