aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorAlexandre Petit-Bianco <apbianco@cygnus.com>2000-07-08 06:23:02 +0000
committerAlexandre Petit-Bianco <apbianco@gcc.gnu.org>2000-07-07 23:23:02 -0700
commit2f2bd00a8f84d78a80801bcb9c1df3d0c6d45a39 (patch)
treea008e98644f524f6d1620152f2ac0df80da2b02d /gcc
parentaaaf7848cdb4f86e4f90b92e541d2388da06345d (diff)
downloadgcc-2f2bd00a8f84d78a80801bcb9c1df3d0c6d45a39.zip
gcc-2f2bd00a8f84d78a80801bcb9c1df3d0c6d45a39.tar.gz
gcc-2f2bd00a8f84d78a80801bcb9c1df3d0c6d45a39.tar.bz2
parse.y (generate_classfile): Exclude null strings.
2000-07-07 Alexandre Petit-Bianco <apbianco@cygnus.com> * parse.y (generate_classfile): Exclude null strings. (http://gcc.gnu.org/ml/gcc-patches/2000-07/msg00233.html) From-SVN: r34923
Diffstat (limited to 'gcc')
-rw-r--r--gcc/java/ChangeLog4
-rw-r--r--gcc/java/jcf-write.c3
2 files changed, 6 insertions, 1 deletions
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog
index 42368c0..1241408 100644
--- a/gcc/java/ChangeLog
+++ b/gcc/java/ChangeLog
@@ -1,5 +1,9 @@
2000-07-07 Alexandre Petit-Bianco <apbianco@cygnus.com>
+ * parse.y (generate_classfile): Exclude null strings.
+
+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.
diff --git a/gcc/java/jcf-write.c b/gcc/java/jcf-write.c
index 0d2a038..0dd17fd 100644
--- a/gcc/java/jcf-write.c
+++ b/gcc/java/jcf-write.c
@@ -2877,7 +2877,8 @@ generate_classfile (clas, state)
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)) == INTEGER_CST
+ && !TREE_TYPE (part) == string_type_node)
|| TREE_CODE (DECL_INITIAL (part)) == REAL_CST);
if (have_value)
attr_count++;