From 9c70b1c26a2f7eb9f88d6d5230f3a8e9bfbc8f51 Mon Sep 17 00:00:00 2001 From: Cristian Cadar Date: Tue, 11 Sep 2012 10:14:05 +0000 Subject: Patch by Dan Liew for ConstantExpr::isTrue() and ConstantExpr::isFalse(): http://keeda.stanford.edu/pipermail/klee-dev/2012-August/000892.html git-svn-id: https://llvm.org/svn/llvm-project/klee/trunk@163606 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/klee/Expr.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/klee/Expr.h b/include/klee/Expr.h index 8d5306f8..2852bf81 100644 --- a/include/klee/Expr.h +++ b/include/klee/Expr.h @@ -398,12 +398,12 @@ public: /// isTrue - Is this the true expression. bool isTrue() const { - return getZExtValue(1) == 1; + return (getWidth() == Expr::Bool && value.getBoolValue()==true); } /// isFalse - Is this the false expression. bool isFalse() const { - return getZExtValue(1) == 0; + return (getWidth() == Expr::Bool && value.getBoolValue()==false); } /// isAllOnes - Is this constant all ones. -- cgit 1.4.1