🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by Markus Armbruster Tue, 03 Nov 1992 16:39
GNU Make version 3.62 bug
#60
Author: Markus Armbruster
Date: Tue, 03 Nov 1992 16:39
60 lines
1889 bytes
Dear Roland,

The following Makefile causes GNU Make version 3.62 on a Sun-4 to dump
core:

all : nothing

/one/% :: /two/%
	echo gnu

/three/% :: /four/%
	echo gnat

The bug is in rule.c, function count_implicit_rule_limits ().  This
function iterates along a list, rule points to the current list node,
lastrule to the previous one except at the list's head, where lastrule
== rule (freerule () depends on this fact!).  After unlinking the
first list node from the list, this condition does not hold.  If you
try to unlink the second one, too, freerule aborts.  Quick fix:

>diff -u rule.c~ rule.c
--- rule.c~	Wed Aug  7 23:32:00 1991
+++ rule.c	Tue Nov  3 15:03:09 1992
@@ -108,8 +108,17 @@
 		{
 		  if (*name == '/')
 		    {
-		      freerule (rule, lastrule);
-		      rule = lastrule;
+		      if (pattern_rules == rule)
+			{
+			  freerule (rule, lastrule);
+			  rule = lastrule = pattern_rules;
+			}
+		      else
+			{
+			  freerule (rule, lastrule);
+			  lastrule = rule;
+			  rule = rule->next;
+			}
 		      goto end_main_loop;
 		    }
 		  else
@@ -121,9 +130,9 @@
       if (ndeps > max_pattern_deps)
 	max_pattern_deps = ndeps;
 
-    end_main_loop:;
       lastrule = rule;
       rule = rule->next;
+    end_main_loop:;
     }
   
   if (name != 0)


Hope, this helps improving an already very good program.

Kind regards,
	Markus
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads