aboutsummaryrefslogtreecommitdiff
path: root/gcc/java/jcf-write.c
diff options
context:
space:
mode:
authorAlexandre Petit-Bianco <apbianco@cygnus.com>2000-07-08 03:35:20 +0000
committerAlexandre Petit-Bianco <apbianco@gcc.gnu.org>2000-07-07 20:35:20 -0700
commit629d4b4db8204ee836367f683e5450015ee4034d (patch)
tree5f831f1a2e5f374c3ad4969dc34df75ec8eab2fa /gcc/java/jcf-write.c
parentcf00a885103d939b2175adc8918908a3b6f211d2 (diff)
downloadgcc-629d4b4db8204ee836367f683e5450015ee4034d.zip
gcc-629d4b4db8204ee836367f683e5450015ee4034d.tar.gz
gcc-629d4b4db8204ee836367f683e5450015ee4034d.tar.bz2
jcf-write.c (generate_classfile): Properly install the ConstantValue attribute and the initial value constant...
2000-07-07 Alexandre Petit-Bianco <apbianco@cygnus.com> * jcf-write.c (generate_classfile): Properly install the ConstantValue attribute and the initial value constant pool index on string constants. * parse.y (java_complete_lhs): Keep DECL_INITIAL when emitting class files. (http://gcc.gnu.org/ml/gcc-patches/2000-07/msg00233.html) From-SVN: r34921
Diffstat (limited to 'gcc/java/jcf-write.c')
-rw-r--r--gcc/java/jcf-write.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/gcc/java/jcf-write.c b/gcc/java/jcf-write.c
index ecd14af..0d2a038 100644
--- a/gcc/java/jcf-write.c
+++ b/gcc/java/jcf-write.c
@@ -2874,8 +2874,11 @@ generate_classfile (clas, state)
i = find_utf8_constant (&state->cpool,
build_java_signature (TREE_TYPE (part)));
PUT2(i);
- have_value = DECL_INITIAL (part) != NULL_TREE && FIELD_STATIC (part)
- && TREE_CODE (TREE_TYPE (part)) != POINTER_TYPE;
+ have_value = DECL_INITIAL (part) != NULL_TREE
+ && FIELD_STATIC (part)
+ && (TREE_CODE (DECL_INITIAL (part)) == STRING_CST
+ || TREE_CODE (DECL_INITIAL (part)) == INTEGER_CST
+ || TREE_CODE (DECL_INITIAL (part)) == REAL_CST);
if (have_value)
attr_count++;