* g++spec.c (lang_specific_driver): Add room for NULL in arglist.
authorMumit Khan <khan@xraylith.wisc.edu>
Tue, 24 Aug 1999 04:20:18 +0000 (04:20 +0000)
committerJeff Law <law@gcc.gnu.org>
Tue, 24 Aug 1999 04:20:18 +0000 (22:20 -0600)
From-SVN: r28812

gcc/cp/ChangeLog
gcc/cp/g++spec.c

index 77deef6d25bfc3f1e921195395d6b35496cd4862..8ceb65995c00a3419019562d5a27afa34791898a 100644 (file)
@@ -1,3 +1,7 @@
+Mon Aug 23 22:17:20 1999  Mumit Khan  <khan@xraylith.wisc.edu>
+
+       * g++spec.c (lang_specific_driver): Add room for NULL in arglist.
+
 1999-08-23  Jason Merrill  <jason@yorick.cygnus.com>
 
        * exception.cc (__cplus_type_matcher): Call __throw_type_match_rtti_2.
index 806b90ea96f0fe410c45a51aef569a00034d6fd7..7e4d49cf01474540f3390f49ebfc61606adb9e52 100644 (file)
@@ -197,7 +197,8 @@ lang_specific_driver (fn, in_argc, in_argv, in_added_libraries)
       return;
     }
 
-  num_args = argc + added + need_math;
+  /* Make sure to have room for the trailing NULL argument.  */
+  num_args = argc + added + need_math + 1;
   arglist = (char **) xmalloc (num_args * sizeof (char *));
 
   /* NOTE: We start at 1 now, not 0.  */