fix a bug handling 'not x' when x is undef.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@88864 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Transforms/Scalar/JumpThreading.cpp b/lib/Transforms/Scalar/JumpThreading.cpp
index d5ce86a..de4c118 100644
--- a/lib/Transforms/Scalar/JumpThreading.cpp
+++ b/lib/Transforms/Scalar/JumpThreading.cpp
@@ -350,8 +350,9 @@
 
       // Invert the known values.
       for (unsigned i = 0, e = Result.size(); i != e; ++i)
-        Result[i].first =
-          cast<ConstantInt>(ConstantExpr::getNot(Result[i].first));
+        if (Result[i].first)
+          Result[i].first =
+            cast<ConstantInt>(ConstantExpr::getNot(Result[i].first));
       return true;
     }
   }