From 496849ba9adf83390849c27eb83d556c5d403cb6 Mon Sep 17 00:00:00 2001 From: Alexandre Petit-Bianco Date: Fri, 24 Aug 2001 10:40:54 -0700 Subject: jcf-parse.c (yyparse): Set magic to 0, don't issue error for a file smaller than 4 bytes. 2001-08-23 Alexandre Petit-Bianco * jcf-parse.c (yyparse): Set magic to 0, don't issue error for a file smaller than 4 bytes. * parse.y (check_inner_circular_reference): New function. (check_circular_reference): Likewise. (array_initializer:): Accept {,}. (java_check_circular_reference): Rewritten using check_circular_reference and check_inner_circular_reference. (java_complete_expand_method): Unconditionally save and restore the unpurged exception list. (build_dot_class_method_invocation): Unmangle signature parameter. (http://gcc.gnu.org/ml/gcc-patches/2001-08/msg01417.html) From-SVN: r45156 --- gcc/java/jcf-parse.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'gcc/java/jcf-parse.c') diff --git a/gcc/java/jcf-parse.c b/gcc/java/jcf-parse.c index e258167..b52f1c1 100644 --- a/gcc/java/jcf-parse.c +++ b/gcc/java/jcf-parse.c @@ -1088,7 +1088,7 @@ yyparse () for (node = current_file_list; node; node = TREE_CHAIN (node)) { unsigned char magic_string[4]; - uint32 magic; + uint32 magic = 0; tree name = TREE_VALUE (node); /* Skip already parsed files */ @@ -1110,11 +1110,11 @@ yyparse () input_filename = IDENTIFIER_POINTER (name); /* Figure what kind of file we're dealing with */ - if (fread (magic_string, 1, 4, finput) != 4) - fatal_io_error ("Premature end of input file %s", - IDENTIFIER_POINTER (name)); - fseek (finput, 0L, SEEK_SET); - magic = GET_u4 (magic_string); + if (fread (magic_string, 1, 4, finput) == 4) + { + fseek (finput, 0L, SEEK_SET); + magic = GET_u4 (magic_string); + } if (magic == 0xcafebabe) { CLASS_FILE_P (node) = 1; -- cgit v1.1