OSDN Git Service

Don't crash on Sizeof of undefined type.
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 15 Dec 2010 23:56:51 +0000 (23:56 +0000)
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 15 Dec 2010 23:56:51 +0000 (23:56 +0000)
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@167883 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/go/gofrontend/expressions.cc

index 844ff66..4f6e4ed 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;