From 5f037b6439856fa4a8414c00838cfbe5b794b560 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sun, 15 Nov 2009 19:57:43 +0000 Subject: fix a bug handling 'not x' when x is undef. llvm-svn: 88864 --- llvm/lib/Transforms/Scalar/JumpThreading.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'llvm/lib') diff --git a/llvm/lib/Transforms/Scalar/JumpThreading.cpp b/llvm/lib/Transforms/Scalar/JumpThreading.cpp index d5ce86aca0c..de4c118b69d 100644 --- a/llvm/lib/Transforms/Scalar/JumpThreading.cpp +++ b/llvm/lib/Transforms/Scalar/JumpThreading.cpp @@ -350,8 +350,9 @@ ComputeValueKnownInPredecessors(Value *V, BasicBlock *BB,PredValueInfo &Result){ // Invert the known values. for (unsigned i = 0, e = Result.size(); i != e; ++i) - Result[i].first = - cast(ConstantExpr::getNot(Result[i].first)); + if (Result[i].first) + Result[i].first = + cast(ConstantExpr::getNot(Result[i].first)); return true; } } -- cgit v1.2.3