Commit 44a2150d by Zack Weinberg Committed by Zack Weinberg

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
parent 30a20a1e
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> 2001-03-28 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* expr.c (pop_type_0): Call `concat' rather than building the * expr.c (pop_type_0): Call `concat' rather than building the
......
...@@ -356,9 +356,15 @@ pop_type_0 (type, messagep) ...@@ -356,9 +356,15 @@ pop_type_0 (type, messagep)
return object_ptr_type_node; return object_ptr_type_node;
} }
*messagep = concat ("expected type '", lang_printable_name (type, 0), /* lang_printable_name uses a static buffer, so we must save the result
"' but stack contains '", lang_printable_name (t, 0), from calling it the first time. */
"'", NULL); {
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; return type;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment