gollvm: fix bug in materialize of conditional expression

Fix a bug in the code that materializes conditional expressions
(triggered by the recent gofrontend changes to bounds checking). Avoid
creating a temporary variable for the conditional if either the Btype
of the expression itself is void, or the Btype of the "else"
expression is void, otherwise we may wind up trying to create an
alloca with void type.

Fixes golang/go#33964.

Change-Id: I9a2ea902026d0bd8d56ead9dfcc22685ef6e7a62
Reviewed-on: https://go-review.googlesource.com/c/gollvm/+/192538
Reviewed-by: Cherry Zhang <cherryyz@google.com>
diff --git a/bridge/go-llvm-materialize.cpp b/bridge/go-llvm-materialize.cpp
index c25f897..4ed16ed 100644
--- a/bridge/go-llvm-materialize.cpp
+++ b/bridge/go-llvm-materialize.cpp
@@ -467,7 +467,7 @@
 
   // FIXME: add lifetime intrinsics for temp var below.
   Bstatement *thenStmt = nullptr;
-  if (!btype || then_expr->btype() == void_type())
+  if (!btype || then_expr->btype() == void_type() || btype == void_type())
     thenStmt = expression_statement(function, then_expr);
   else
     tempv = temporary_variable(function, nullptr,