read-rtl.c (read_rtx_1): Give fatal error if we see a vector with no elements.
authorIan Lance Taylor <ian@airs.com>
Fri, 11 Feb 2005 15:09:53 +0000 (15:09 +0000)
committerIan Lance Taylor <ian@gcc.gnu.org>
Fri, 11 Feb 2005 15:09:53 +0000 (15:09 +0000)
* read-rtl.c (read_rtx_1): Give fatal error if we see a vector
with no elements.

From-SVN: r94879

gcc/ChangeLog
gcc/read-rtl.c

index b5a284a..8740f2b 100644 (file)
@@ -1,5 +1,8 @@
 2005-02-11  Ian Lance Taylor  <ian@airs.com>
 
+       * read-rtl.c (read_rtx_1): Give fatal error if we see a vector
+       with no elements.
+
        * tree.c (build_function_type_list): Work correctly if there are
        no arguments.
 
index c9a3fee..874dd3b 100644 (file)
@@ -1253,6 +1253,9 @@ read_rtx_1 (FILE *infile)
              memcpy (&return_vec->elem[0], obstack_finish (&vector_stack),
                      list_counter * sizeof (rtx));
            }
+         else if (format_ptr[i] == 'E')
+           fatal_with_file_and_line (infile,
+                                     "vector must have at least one element");
          XVEC (return_rtx, i) = return_vec;
          obstack_free (&vector_stack, NULL);
          /* close bracket gotten */