From 061ac426189161b669a2a0b6e67fab19e7fde25d Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Fri, 29 Jan 1999 15:16:12 +0000 Subject: [PATCH] parse.h (BUILD_APPEND): If ARG is a non-String object reference... * parse.h (BUILD_APPEND): If ARG is a non-String object reference, then cast it to Object before calling `append' method. From-SVN: r24907 --- gcc/java/ChangeLog | 5 +++++ gcc/java/parse.c | 8 ++++---- gcc/java/parse.h | 13 ++++++++++--- 3 files changed, 19 insertions(+), 7 deletions(-) diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog index c969046a07e..370a37c3645 100644 --- a/gcc/java/ChangeLog +++ b/gcc/java/ChangeLog @@ -1,3 +1,8 @@ +1999-01-29 Tom Tromey + + * parse.h (BUILD_APPEND): If ARG is a non-String object reference, + then cast it to Object before calling `append' method. + Thu Jan 28 14:45:39 1999 Per Bothner * check-init.c (check_bool2_init, check_bool_init, check_init): diff --git a/gcc/java/parse.c b/gcc/java/parse.c index 934bf4f9a7b..1579499d7f4 100644 --- a/gcc/java/parse.c +++ b/gcc/java/parse.c @@ -2251,7 +2251,7 @@ static const short yycheck[] = { 3, #define YYPURE 1 /* -*-C-*- Note some compilers choke on comments on `#line' lines. */ -#line 3 "/usr/local/gnu/share/bison.simple" +#line 3 "/usr/share/misc/bison.simple" /* Skeleton output parser for bison, Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc. @@ -2268,7 +2268,7 @@ static const short yycheck[] = { 3, You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* As a special exception, when this file is copied by Bison into a Bison output file, you may use that output file without restriction. @@ -2444,7 +2444,7 @@ __yy_memcpy (char *to, char *from, int count) #endif #endif -#line 196 "/usr/local/gnu/share/bison.simple" +#line 196 "/usr/share/misc/bison.simple" /* The user can define YYPARSE_PARAM as the name of an argument to be passed into yyparse. The argument should have type void *. @@ -4702,7 +4702,7 @@ case 492: break;} } /* the action file gets copied in in place of this dollarsign */ -#line 498 "/usr/local/gnu/share/bison.simple" +#line 498 "/usr/share/misc/bison.simple" yyvsp -= yylen; yyssp -= yylen; diff --git a/gcc/java/parse.h b/gcc/java/parse.h index 4cebd5b8659..13604eed34a 100644 --- a/gcc/java/parse.h +++ b/gcc/java/parse.h @@ -498,9 +498,16 @@ static jdeplist *reverse_jdep_list (); #define COMPLETE_CHECK_OP_2(NODE) COMPLETE_CHECK_OP(NODE, 2) /* Building invocations: append(ARG) and StringBuffer(ARG) */ -#define BUILD_APPEND(ARG) \ - build_method_invocation (wfl_append, \ - (ARG ? build_tree_list (NULL, (ARG)): NULL_TREE)) +#define BUILD_APPEND(ARG) \ + ((JSTRING_TYPE_P (TREE_TYPE (ARG)) || JPRIMITIVE_TYPE_P (TREE_TYPE (ARG))) \ + ? build_method_invocation (wfl_append, \ + ARG ? build_tree_list (NULL, (ARG)) : NULL_TREE)\ + : build_method_invocation (wfl_append, \ + ARG ? build_tree_list (NULL, \ + build1 (CONVERT_EXPR, \ + object_type_node,\ + (ARG))) \ + : NULL_TREE)) #define BUILD_STRING_BUFFER(ARG) \ build_new_invocation (wfl_string_buffer, \ (ARG ? build_tree_list (NULL, (ARG)) : NULL_TREE)) -- 2.30.2