diff options
author | Ian Lance Taylor <ian@gcc.gnu.org> | 2014-03-28 05:20:48 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2014-03-28 05:20:48 +0000 |
commit | 3700e94730ea1cc5fe9db522607d6a23b3667a55 (patch) | |
tree | 0d913741459464155b0c7f225ee1a5bd2409b0d6 /gcc/go | |
parent | c63de3b3f8b6602b3800be478e092ec126980b1a (diff) | |
download | gcc-3700e94730ea1cc5fe9db522607d6a23b3667a55.zip gcc-3700e94730ea1cc5fe9db522607d6a23b3667a55.tar.gz gcc-3700e94730ea1cc5fe9db522607d6a23b3667a55.tar.bz2 |
re PR other/59545 (Signed integer overflow issues)
PR other/59545
compiler: Fix bogus invalid static_cast to Unary_expression.
From-SVN: r208888
Diffstat (limited to 'gcc/go')
-rw-r--r-- | gcc/go/gofrontend/expressions.cc | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/gcc/go/gofrontend/expressions.cc b/gcc/go/gofrontend/expressions.cc index 643a233..f45b4a2 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<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. |