diff options
author | Zack Weinberg <zackw@stanford.edu> | 2001-04-03 01:01:41 +0000 |
---|---|---|
committer | Zack Weinberg <zack@gcc.gnu.org> | 2001-04-03 01:01:41 +0000 |
commit | 44a2150dce36055e552f408433327d0ead1359d0 (patch) | |
tree | c3db32d8130542bcf75cf7b14580d9da46c60023 | |
parent | 30a20a1ee0168656d375ea2333e14b46937bdc6a (diff) | |
download | gcc-44a2150dce36055e552f408433327d0ead1359d0.tar.gz |
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
-rw-r--r-- | gcc/java/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/java/expr.c | 12 |
2 files changed, 15 insertions, 3 deletions
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog index e9f24dfb876..ac8ee1c8ce1 100644 --- a/gcc/java/ChangeLog +++ b/gcc/java/ChangeLog @@ -1,3 +1,9 @@ +2001-04-02 Zack Weinberg <zackw@stanford.edu> + + * 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. + 2001-03-28 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> * expr.c (pop_type_0): Call `concat' rather than building the 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; } |