aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/llvm/Support/PatternMatch.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/llvm/Support/PatternMatch.h b/include/llvm/Support/PatternMatch.h
index bee416a24e..2d498a3561 100644
--- a/include/llvm/Support/PatternMatch.h
+++ b/include/llvm/Support/PatternMatch.h
@@ -310,7 +310,7 @@ struct cast_match {
return Op.match(I->getOperand(0));
} else if (ConstantExpr *CE = dyn_cast<ConstantExpr>(V)) {
if (CE->getOpcode() == Instruction::Cast) {
- if (DestTy) *DestTy = I->getType();
+ if (DestTy) *DestTy = CE->getType();
return Op.match(CE->getOperand(0));
}
}