From: Martin Liska Date: Sat, 2 Oct 2021 07:31:46 +0000 (+0200) Subject: options: fix ASAN issue during saving of opt. options X-Git-Tag: basepoints/gcc-13~4221 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bda4aa3673267bdb20b67326072ee3e7e2b29698;p=thirdparty%2Fgcc.git options: fix ASAN issue during saving of opt. options gcc/ChangeLog: * toplev.c (toplev::main): save_decoded_options[0] is program name and so it should be skipped. --- diff --git a/gcc/toplev.c b/gcc/toplev.c index 78bb7e9749b6..d952319ad95b 100644 --- a/gcc/toplev.c +++ b/gcc/toplev.c @@ -2338,7 +2338,7 @@ toplev::main (int argc, char **argv) &save_decoded_options_count); /* Save Optimization decoded options. */ - for (unsigned i = 0; i < save_decoded_options_count; ++i) + for (unsigned i = 1; i < save_decoded_options_count; ++i) if (cl_options[save_decoded_options[i].opt_index].flags & CL_OPTIMIZATION) save_opt_decoded_options.safe_push (save_decoded_options[i]);