re PR other/59545 (Signed integer overflow issues)
authorIan Lance Taylor <ian@gcc.gnu.org>
Fri, 28 Mar 2014 05:20:48 +0000 (05:20 +0000)
committerIan Lance Taylor <ian@gcc.gnu.org>
Fri, 28 Mar 2014 05:20:48 +0000 (05:20 +0000)
PR other/59545
compiler: Fix bogus invalid static_cast to Unary_expression.

From-SVN: r208888

gcc/go/gofrontend/expressions.cc

index 643a233..f45b4a2 100644 (file)
@@ -4262,8 +4262,12 @@ Unary_expression::do_get_tree(Translate_context* context)
 
           go_assert(!this->expr_->is_composite_literal()
                     || this->expr_->is_immutable());
-          Unary_expression* ue = static_cast<Unary_expression*>(this->expr_);
-          go_assert(ue == NULL || ue->op() != OPERATOR_AND);
+         if (this->expr_->classification() == EXPRESSION_UNARY)
+           {
+             Unary_expression* ue =
+               static_cast<Unary_expression*>(this->expr_);
+             go_assert(ue->op() != OPERATOR_AND);
+           }
        }
 
       // Build a decl for a constant constructor.