fix crash when codegening 'cond ? lhs : call-to-void-func()'

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51958 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/CGExprScalar.cpp b/lib/CodeGen/CGExprScalar.cpp
index 622d2c5..ea92828 100644
--- a/lib/CodeGen/CGExprScalar.cpp
+++ b/lib/CodeGen/CGExprScalar.cpp
@@ -1074,7 +1074,7 @@
   
   CGF.EmitBlock(ContBlock);
   
-  if (!LHS) {
+  if (!LHS || !RHS) {
     assert(E->getType()->isVoidType() && "Non-void value should have a value");
     return 0;
   }