From: Ian Lance Taylor Date: Fri, 28 Mar 2014 05:20:48 +0000 (+0000) Subject: re PR other/59545 (Signed integer overflow issues) X-Git-Tag: releases/gcc-4.9.0~261 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3700e94730ea1cc5fe9db522607d6a23b3667a55;p=thirdparty%2Fgcc.git re PR other/59545 (Signed integer overflow issues) PR other/59545 compiler: Fix bogus invalid static_cast to Unary_expression. From-SVN: r208888 --- diff --git a/gcc/go/gofrontend/expressions.cc b/gcc/go/gofrontend/expressions.cc index 643a233ba004..f45b4a227096 100644 --- a/gcc/go/gofrontend/expressions.cc +++ b/gcc/go/gofrontend/expressions.cc @@ -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(this->expr_); - go_assert(ue == NULL || ue->op() != OPERATOR_AND); + if (this->expr_->classification() == EXPRESSION_UNARY) + { + Unary_expression* ue = + static_cast(this->expr_); + go_assert(ue->op() != OPERATOR_AND); + } } // Build a decl for a constant constructor.