summaryrefslogtreecommitdiffstats
path: root/gcc/java/expr.c
diff options
context:
space:
mode:
authorzack <zack@138bc75d-0d04-0410-961f-82ee72b054a4>2001-04-03 01:01:41 +0000
committerzack <zack@138bc75d-0d04-0410-961f-82ee72b054a4>2001-04-03 01:01:41 +0000
commit492bd46e0a81eeaf4227c15fff6bb0cba5c547f2 (patch)
treec3db32d8130542bcf75cf7b14580d9da46c60023 /gcc/java/expr.c
parent40b5528551e0b9a421b6c8b6342a22e703711b1c (diff)
downloadppe42-gcc-492bd46e0a81eeaf4227c15fff6bb0cba5c547f2.tar.gz
ppe42-gcc-492bd46e0a81eeaf4227c15fff6bb0cba5c547f2.zip
* expr.c (pop_type_0): Save the result of the first
lang_printable_name call in a scratch buffer, so it won't be clobbered by the second call. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@41032 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/java/expr.c')
-rw-r--r--gcc/java/expr.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/gcc/java/expr.c b/gcc/java/expr.c
index 2ea6a813526..cb9ae160931 100644
--- a/gcc/java/expr.c
+++ b/gcc/java/expr.c
@@ -356,9 +356,15 @@ pop_type_0 (type, messagep)
return object_ptr_type_node;
}
- *messagep = concat ("expected type '", lang_printable_name (type, 0),
- "' but stack contains '", lang_printable_name (t, 0),
- "'", NULL);
+ /* lang_printable_name uses a static buffer, so we must save the result
+ from calling it the first time. */
+ {
+ char *temp = xstrdup (lang_printable_name (type, 0));
+ *messagep = concat ("expected type '", temp,
+ "' but stack contains '", lang_printable_name (t, 0),
+ "'", NULL);
+ free (temp);
+ }
return type;
}
OpenPOWER on IntegriCloud