From: Jim Wilson Date: Mon, 2 May 1994 20:53:21 +0000 (-0700) Subject: (translate_options): For options that take an argument, X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e184d694d8f474bff290192538d1d6604833644d;p=gcc.git (translate_options): For options that take an argument, don't skip the argument if it doesn't exist. From-SVN: r7190 --- diff --git a/gcc/gcc.c b/gcc/gcc.c index 8e11ad3ba32..a9adb8f5a41 100644 --- a/gcc/gcc.c +++ b/gcc/gcc.c @@ -900,6 +900,12 @@ translate_options (argcp, argvp) else if (! strcmp (p, "Xlinker")) nskip += 1; + /* Watch out for an option at the end of the command line that + is missing arguments, and avoid skipping past the end of the + command line. */ + if (nskip + i > argc) + nskip = argc - i; + while (nskip > 0) { newv[newindex++] = argv[i++];