Commit 289b57ee by Per Bothner Committed by Per Bothner

class.c (set_constant_value): When not emiting class files, then a String…

class.c (set_constant_value): When not emiting class files, then a String ConstantValue is a utf8const_ptr_type.


	* class.c (set_constant_value):  When not emiting class files, then a
	String ConstantValue is a utf8const_ptr_type.

From-SVN: r45333
parent 6268b922
2001-08-31 Per Bothner <per@bothner.com>
* class.c (set_constant_value): When not emiting class files, then a
String ConstantValue is a utf8const_ptr_type.
2001-08-30 Per Bothner <per@bothner.com>
* jcf-write.c (generate_classfile): Check that field is primitive
......
......@@ -780,8 +780,10 @@ set_constant_value (field, constant)
if (TREE_TYPE (constant) != TREE_TYPE (field)
&& ! (TREE_TYPE (constant) == int_type_node
&& INTEGRAL_TYPE_P (TREE_TYPE (field))
&& TYPE_PRECISION (TREE_TYPE (field)) <= 32))
warning ("ConstantValue attribute of field '%s' has wrong type",
&& TYPE_PRECISION (TREE_TYPE (field)) <= 32)
&& ! (TREE_TYPE (constant) == utf8const_ptr_type
&& TREE_TYPE (field) == string_ptr_type_node))
error ("ConstantValue attribute of field '%s' has wrong type",
IDENTIFIER_POINTER (DECL_NAME (field)));
if (FIELD_FINAL (field))
DECL_FIELD_FINAL_IUD (field) = 1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment