Commit 0ef38928 by Per Bothner Committed by Per Bothner

jcf-parse.c (HANDLE_EXCEPTIONS_ATTRIBUTE): New macro.

8
	* jcf-parse.c (HANDLE_EXCEPTIONS_ATTRIBUTE):  New macro.
	* jcf-io.c (find_class):  Simpler/cleaner structure fixes a bug.

From-SVN: r23659
parent 46689c0b
Sun Nov 15 14:10:56 1998 Per Bothner <bothner@cygnus.com>
* jcf-parse.c (HANDLE_EXCEPTIONS_ATTRIBUTE): New macro.
* jcf-io.c (find_class): Simpler/cleaner structure fixes a bug.
Sat Nov 14 17:19:18 1998 Per Bothner <bothner@cygnus.com> Sat Nov 14 17:19:18 1998 Per Bothner <bothner@cygnus.com>
Allow uses of interface types to verify. This is not really Allow uses of interface types to verify. This is not really
......
...@@ -259,7 +259,7 @@ DEFUN(find_class, (classname, classname_length, jcf, do_class_file), ...@@ -259,7 +259,7 @@ DEFUN(find_class, (classname, classname_length, jcf, do_class_file),
#else #else
int fd; int fd;
#endif #endif
int i, k, java, class; int i, k, java, class = -1;
struct stat java_buf, class_buf; struct stat java_buf, class_buf;
char *dep_file; char *dep_file;
void *entry, *java_entry; void *entry, *java_entry;
...@@ -341,14 +341,9 @@ DEFUN(find_class, (classname, classname_length, jcf, do_class_file), ...@@ -341,14 +341,9 @@ DEFUN(find_class, (classname, classname_length, jcf, do_class_file),
} }
class = stat (buffer, &class_buf); class = stat (buffer, &class_buf);
/* This is a little odd: if we didn't find the class file, we if (class == 0)
can just skip to the next iteration. However, if this is the break;
last iteration, then we want to search for the .java file as }
well. It was a little easier to implement this with two
loops, as opposed to checking for each type of file each time
through the loop. */
if (class && jcf_path_next (entry))
continue;
/* Check for out of synch .class/.java files. */ /* Check for out of synch .class/.java files. */
java = 1; java = 1;
...@@ -365,11 +360,7 @@ DEFUN(find_class, (classname, classname_length, jcf, do_class_file), ...@@ -365,11 +360,7 @@ DEFUN(find_class, (classname, classname_length, jcf, do_class_file),
strcpy (java_buffer, jcf_path_name (java_entry)); strcpy (java_buffer, jcf_path_name (java_entry));
l = strlen (java_buffer); l = strlen (java_buffer);
for (m = 0; m < classname_length; ++m) for (m = 0; m < classname_length; ++m)
{ java_buffer[m + l] = (classname[m] == '.' ? '/' : classname[m]);
java_buffer[m + l] = (classname[m] == '.'
? '/'
: classname[m]);
}
strcpy (java_buffer + m + l, ".java"); strcpy (java_buffer + m + l, ".java");
/* FIXME: until the `.java' parser is fully working, we only /* FIXME: until the `.java' parser is fully working, we only
...@@ -429,7 +420,7 @@ DEFUN(find_class, (classname, classname_length, jcf, do_class_file), ...@@ -429,7 +420,7 @@ DEFUN(find_class, (classname, classname_length, jcf, do_class_file),
} }
} }
#endif #endif
}
free (buffer); free (buffer);
return NULL; return NULL;
found: found:
......
...@@ -155,6 +155,18 @@ set_source_filename (jcf, index) ...@@ -155,6 +155,18 @@ set_source_filename (jcf, index)
DECL_LINENUMBERS_OFFSET (current_method) = JCF_TELL (jcf) - 2; \ DECL_LINENUMBERS_OFFSET (current_method) = JCF_TELL (jcf) - 2; \
JCF_SKIP (jcf, n * 4); } JCF_SKIP (jcf, n * 4); }
#define HANDLE_EXCEPTIONS_ATTRIBUTE(COUNT) \
{ \
int n = COUNT; \
tree list = DECL_FUNCTION_THROWS (current_method); \
while (--n >= 0) \
{ \
tree thrown_class = get_class_constant (jcf, JCF_readu2 (jcf)); \
list = tree_cons (NULL_TREE, thrown_class, list); \
} \
DECL_FUNCTION_THROWS (current_method) = nreverse (list); \
}
#include "jcf-reader.c" #include "jcf-reader.c"
static int yydebug; static int yydebug;
......
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