Fixed Savannah bug #12180.
authorBoris Kolpackov <boris@kolpackov.net>
Tue, 1 Mar 2005 08:01:05 +0000 (08:01 +0000)
committerBoris Kolpackov <boris@kolpackov.net>
Tue, 1 Mar 2005 08:01:05 +0000 (08:01 +0000)
ChangeLog
read.c
tests/ChangeLog
tests/scripts/features/statipattrules

index b9f4ad7464e92afb86d4926fa5b48736bfb57f24..b0b25dcded3c1aae2ac9bdceb21e4c25a3ca196d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Tue Mar  1 10:12:20 2005  Boris Kolpackov  <boris@kolpackov.net>
+
+       * read.c (record_files): Add a check for the list of prerequisites
+       of a static pattern rule being empty. Fixes Savannah bug #12180.
+
 2005-02-28  Paul D. Smith  <psmith@gnu.org>
 
        * doc/make.texi (Text Functions): Update docs to allow the end
diff --git a/read.c b/read.c
index d235c6aae9f343d77ab6001d25c22bd081a3e871..4103555a5fe6721b5b6efb7193dcd8855d0eef2f 100644 (file)
--- a/read.c
+++ b/read.c
@@ -1915,7 +1915,7 @@ record_files (struct nameseq *filenames, char *pattern, char *pattern_percent,
                 the target pattern, the target's name and the dependencies'
                 patterns into plain dependency names.  */
 
-              if (find_percent (this->name) != 0)
+              if (this != 0 && find_percent (this->name) != 0)
                 {
                   PATH_VAR (stem);
                   char *o;
index 1979324361bbe2279a7ba78af9253d039a8838ac..2c5890067e697b2dffc34858764e10548e4cacf1 100644 (file)
@@ -1,3 +1,8 @@
+Tue Mar  1 10:15:25 2005  Boris Kolpackov  <boris@kolpackov.net>
+
+       * tests/scripts/features/statipattrules: Add a test for
+       Savannah bug #12180.
+
 2005-02-28  Paul D. Smith  <psmith@gnu.org>
 
        * scripts/options/dash-q: Add a test for Savannah bug # 7144.
index 29a7c08cbf794116147caabb85e7ad85e389528e..7d35ec3aaac660ebaf0da69f3fa105c7fc5f6f0c 100644 (file)
@@ -62,11 +62,15 @@ close(MAKEFILE);
 $answer = "$makefile2:1: *** target `foo' leaves prerequisite pattern empty.  Stop.\n";
 &compare_output($answer, &get_logfile(1));
 
+# TEST #5 -- bug #12180: core dump on a stat pattern rule with an empty
+#                        prerequisite list.
+#
+run_make_test('
+foo.x bar.x: %.x : ; @echo $@
 
-1;
-
-
-
-
-
+',
+'',
+'foo.x
+');
 
+1;