]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR fortran/58226 (negative subscript pos at fortran/options.c:1205)
authorTobias Burnus <burnus@net-b.de>
Thu, 10 Oct 2013 19:32:22 +0000 (21:32 +0200)
committerTobias Burnus <burnus@gcc.gnu.org>
Thu, 10 Oct 2013 19:32:22 +0000 (21:32 +0200)
2013-10-09  Tobias Burnus  <burnus@net-b.de>

        PR fortran/58226
        * options.c (gfc_get_option_string): Handle zero arg case.

From-SVN: r203394

gcc/fortran/ChangeLog
gcc/fortran/options.c

index 4463ecd84dced8852f5feae28452031b9ad6f151..2a3be8d64f29f57162aa15897aaa2a38944185ee 100644 (file)
@@ -1,3 +1,8 @@
+2013-10-10  Tobias Burnus  <burnus@net-b.de>
+
+       PR fortran/58226
+       * options.c (gfc_get_option_string): Handle zero arg case.
+
 2013-10-02  Tobias Burnus  <burnus@net-b.de>
 
        PR fortran/58593
index 3a9c508dc27e2c9be5b01c99662a65bea4a46792..6e4e7c11696718e1ef3132973454267688eedfb1 100644 (file)
@@ -1166,6 +1166,10 @@ gfc_get_option_string (void)
   size_t len, pos;
   char *result;
 
+  /* Allocate and return a one-character string with '\0'.  */
+  if (!save_decoded_options_count)
+    return XCNEWVEC (char, 1);
+
   /* Determine required string length.  */
 
   len = 0;