aboutsummaryrefslogtreecommitdiff
path: root/gcc/java/expr.c
diff options
context:
space:
mode:
authorZack Weinberg <zackw@stanford.edu>2001-04-03 01:01:41 +0000
committerZack Weinberg <zack@gcc.gnu.org>2001-04-03 01:01:41 +0000
commit44a2150dce36055e552f408433327d0ead1359d0 (patch)
treec3db32d8130542bcf75cf7b14580d9da46c60023 /gcc/java/expr.c
parent30a20a1ee0168656d375ea2333e14b46937bdc6a (diff)
downloadgcc-44a2150dce36055e552f408433327d0ead1359d0.zip
gcc-44a2150dce36055e552f408433327d0ead1359d0.tar.gz
gcc-44a2150dce36055e552f408433327d0ead1359d0.tar.bz2
expr.c (pop_type_0): Save the result of the first lang_printable_name call in a scratch buffer...
* 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. From-SVN: r41032
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 2ea6a81..cb9ae16 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;
}