From 31bbb65ef80c1e18746aad26d005e36cc28b44d2 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Thu, 31 Oct 2002 17:09:06 +0000 Subject: [PATCH] Fix nasty bug in ::isNeg() llvm-svn: 4470 --- lib/VMCore/iOperators.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/VMCore/iOperators.cpp b/lib/VMCore/iOperators.cpp index 5aa9714eb93..5a88986135b 100644 --- a/lib/VMCore/iOperators.cpp +++ b/lib/VMCore/iOperators.cpp @@ -91,7 +91,7 @@ static inline bool isConstantAllOnes(const Value *V) { bool BinaryOperator::isNeg(const Value *V) { if (const BinaryOperator *Bop = dyn_cast(V)) return Bop->getOpcode() == Instruction::Sub && - isa(Bop->getOperand(0)) && cast(V)->isNullValue(); + Bop->getOperand(0) == Constant::getNullValue(Bop->getType()); return false; }