Don't crash on Sizeof of undefined type.
authorIan Lance Taylor <ian@gcc.gnu.org>
Wed, 15 Dec 2010 23:56:51 +0000 (23:56 +0000)
committerIan Lance Taylor <ian@gcc.gnu.org>
Wed, 15 Dec 2010 23:56:51 +0000 (23:56 +0000)
From-SVN: r167883

gcc/go/gofrontend/expressions.cc

index 844ff660a2459916802171ecbd01ea12d4ffcef5..4f6e4ed3622969237b9ba4917a91c32bae38b9c1 100644 (file)
@@ -6722,7 +6722,7 @@ Builtin_call_expression::do_integer_constant_value(bool iota_is_constant,
       if (arg == NULL)
        return false;
       Type* arg_type = arg->type();
-      if (arg_type->is_error_type())
+      if (arg_type->is_error_type() || arg_type->is_undefined())
        return false;
       if (arg_type->is_abstract())
        return false;