From: Per Bothner Date: Fri, 31 Aug 2001 04:14:44 +0000 (-0700) Subject: jcf-write.c (generate_classfile): Check that field is primitive or string before... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=be0c7ff4050a473ce2d989b7ab7ac85fc640490c;p=gcc.git jcf-write.c (generate_classfile): Check that field is primitive or string before emitting ConstantValue attribute. * jcf-write.c (generate_classfile): Check that field is primitive or string before emitting ConstantValue attribute. From-SVN: r45306 --- diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog index 0d9f4c52e4b..b06dd57aa46 100644 --- a/gcc/java/ChangeLog +++ b/gcc/java/ChangeLog @@ -1,3 +1,8 @@ +2001-08-30 Per Bothner + + * jcf-write.c (generate_classfile): Check that field is primitive + or string before emitting ConstantValue attribute. + 2001-08-30 Per Bothner * parse.y (resolve_qualified_expression_name): If creating a diff --git a/gcc/java/jcf-write.c b/gcc/java/jcf-write.c index d090b5678ae..026ceb5d068 100644 --- a/gcc/java/jcf-write.c +++ b/gcc/java/jcf-write.c @@ -2885,7 +2885,9 @@ generate_classfile (clas, state) PUT2(i); have_value = DECL_INITIAL (part) != NULL_TREE && FIELD_STATIC (part) && CONSTANT_VALUE_P (DECL_INITIAL (part)) - && FIELD_FINAL (part); + && FIELD_FINAL (part) + && (JPRIMITIVE_TYPE_P (TREE_TYPE (part)) + || TREE_TYPE (part) == string_ptr_type_node); if (have_value) attr_count++;