]> gcc.gnu.org Git - gcc.git/commitdiff
options: check for CL_OPTIMIZATION only for cl_options.
authorMartin Liska <mliska@suse.cz>
Sun, 3 Oct 2021 12:25:11 +0000 (14:25 +0200)
committerMartin Liska <mliska@suse.cz>
Sun, 3 Oct 2021 12:27:02 +0000 (14:27 +0200)
gcc/ChangeLog:

* toplev.c (toplev::main): Check opt_index if it is a part
of cl_options.

gcc/toplev.c

index d952319ad95b89444fa138a8d9824291f69b7607..ec9f998a49bb60ac5cbcfe390a407d160fd946e9 100644 (file)
@@ -2339,7 +2339,8 @@ toplev::main (int argc, char **argv)
 
   /* Save Optimization decoded options.  */
   for (unsigned i = 1; i < save_decoded_options_count; ++i)
-    if (cl_options[save_decoded_options[i].opt_index].flags & CL_OPTIMIZATION)
+    if (save_decoded_options[i].opt_index < cl_options_count
+       && cl_options[save_decoded_options[i].opt_index].flags & CL_OPTIMIZATION)
       save_opt_decoded_options.safe_push (save_decoded_options[i]);
 
   /* Perform language-specific options initialization.  */
This page took 0.104858 seconds and 5 git commands to generate.