Commit c2a141a0 by Jeff Sturm Committed by Jeff Sturm

re PR rtl-optimization/13024 (gcj can't build current rhug)

Fix PR java/13024.
* except.c (prepare_eh_table_type): Allocate variable-sized
buffer `buf' with alloca.

From-SVN: r73752
parent 6df5a5c7
2003-11-19 Jeff Sturm <jsturm@one-point.com>
Fix PR java/13024.
* except.c (prepare_eh_table_type): Allocate variable-sized
buffer `buf' with alloca.
2003-11-17 Jeff Sturm <jsturm@one-point.com> 2003-11-17 Jeff Sturm <jsturm@one-point.com>
Fix PR java/12857. Fix PR java/12857.
......
...@@ -312,6 +312,10 @@ tree ...@@ -312,6 +312,10 @@ tree
prepare_eh_table_type (tree type) prepare_eh_table_type (tree type)
{ {
tree exp; tree exp;
const char *name;
char *buf;
tree decl;
tree utf8_ref;
/* The "type" (match_info) in a (Java) exception table is a pointer to: /* The "type" (match_info) in a (Java) exception table is a pointer to:
* a) NULL - meaning match any type in a try-finally. * a) NULL - meaning match any type in a try-finally.
...@@ -323,10 +327,9 @@ prepare_eh_table_type (tree type) ...@@ -323,10 +327,9 @@ prepare_eh_table_type (tree type)
exp = NULL_TREE; exp = NULL_TREE;
else if (is_compiled_class (type) && !flag_indirect_dispatch) else if (is_compiled_class (type) && !flag_indirect_dispatch)
{ {
char buf[64]; name = IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (type)));
tree decl; buf = alloca (strlen (name) + 5);
sprintf (buf, "%s_ref", sprintf (buf, "%s_ref", name);
IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (type))));
decl = build_decl (VAR_DECL, get_identifier (buf), ptr_type_node); decl = build_decl (VAR_DECL, get_identifier (buf), ptr_type_node);
TREE_STATIC (decl) = 1; TREE_STATIC (decl) = 1;
DECL_ARTIFICIAL (decl) = 1; DECL_ARTIFICIAL (decl) = 1;
...@@ -342,11 +345,10 @@ prepare_eh_table_type (tree type) ...@@ -342,11 +345,10 @@ prepare_eh_table_type (tree type)
} }
else else
{ {
tree decl; utf8_ref = build_utf8_ref (DECL_NAME (TYPE_NAME (type)));
tree utf8_ref = build_utf8_ref (DECL_NAME (TYPE_NAME (type))); name = IDENTIFIER_POINTER (DECL_NAME (TREE_OPERAND (utf8_ref, 0)));
char buf[64]; buf = alloca (strlen (name) + 5);
sprintf (buf, "%s_ref", sprintf (buf, "%s_ref", name);
IDENTIFIER_POINTER (DECL_NAME (TREE_OPERAND (utf8_ref, 0))));
decl = build_decl (VAR_DECL, get_identifier (buf), utf8const_ptr_type); decl = build_decl (VAR_DECL, get_identifier (buf), utf8const_ptr_type);
TREE_STATIC (decl) = 1; TREE_STATIC (decl) = 1;
DECL_ARTIFICIAL (decl) = 1; DECL_ARTIFICIAL (decl) = 1;
......
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