From 16c771d54330d73cc66b52922f37a4b6755d04b0 Mon Sep 17 00:00:00 2001 From: Peter Collingbourne Date: Sat, 7 Apr 2012 01:48:51 +0000 Subject: Fix ConstantExpr::is{Zero,One,AllOnes} for arbitrary bitwidths. git-svn-id: https://llvm.org/svn/llvm-project/klee/trunk@154245 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/klee/Expr.h | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'include') diff --git a/include/klee/Expr.h b/include/klee/Expr.h index 3e296934..09b288a8 100644 --- a/include/klee/Expr.h +++ b/include/klee/Expr.h @@ -391,10 +391,10 @@ public: /* Utility Functions */ /// isZero - Is this a constant zero. - bool isZero() const { return getZExtValue() == 0; } + bool isZero() const { return getAPValue().isMinValue(); } /// isOne - Is this a constant one. - bool isOne() const { return getZExtValue() == 1; } + bool isOne() const { return getLimitedValue() == 1; } /// isTrue - Is this the true expression. bool isTrue() const { @@ -407,9 +407,7 @@ public: } /// isAllOnes - Is this constant all ones. - bool isAllOnes() const { - return getZExtValue(getWidth()) == bits64::maxValueOfNBits(getWidth()); - } + bool isAllOnes() const { return getAPValue().isAllOnesValue(); } /* Constant Operations */ -- cgit 1.4.1