]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
compiler: handle abstract type in builtin numeric const value
authorIan Lance Taylor <ian@gcc.gnu.org>
Mon, 5 Nov 2018 20:59:38 +0000 (20:59 +0000)
committerIan Lance Taylor <ian@gcc.gnu.org>
Mon, 5 Nov 2018 20:59:38 +0000 (20:59 +0000)
    Builtin_call_expression::do_numeric_constant_value can be called by
    Array_type::verify_length before the determine types pass, so accept
    an abstract type.

    Test case is https://golang.org/cl/147537.

    Fixes golang/go#28601

    Reviewed-on: https://go-review.googlesource.com/c/147442

From-SVN: r265818

gcc/go/gofrontend/expressions.cc

index fee3203714f4fbd4c97b6173b39e188314587833..1f43c4af16f736f45d2e2c93c91a2f01123d21d7 100644 (file)
@@ -8065,7 +8065,7 @@ Builtin_call_expression::do_numeric_constant_value(Numeric_constant* nc) const
       if (arg_type->is_error())
        return false;
       if (arg_type->is_abstract())
-       return false;
+       arg_type = arg_type->make_non_abstract_type();
       if (this->seen_)
         return false;