]> git.ipfire.org Git - thirdparty/make.git/commit
[SV 47995] Ensure forced double-colon rules work with -j.
authorPaul Smith <psmith@gnu.org>
Tue, 31 May 2016 06:56:51 +0000 (02:56 -0400)
committerPaul Smith <psmith@gnu.org>
Tue, 31 May 2016 07:17:26 +0000 (03:17 -0400)
commit4762480ae9cb8df4878286411f178d32db14eff0
tree97a04dc5edf9f5cd73198e8d38cbcf84c15c01cc
parentef6c059e1e4ff119aef48f3ce164bef4cbf467e6
[SV 47995] Ensure forced double-colon rules work with -j.

The fix for SV 44742 had a side-effect that some double-colon targets
were skipped.  This happens because the "considered" facility assumed
that all targets would be visited on each walk through the dependency
graph: we used a bit for considered and toggled it on each pass; if
we didn't walk the entire graph on every pass the bit would get out
of sync.  The new behavior after SV 44742 might return early without
walking the entire graph.  To fix this I changed the considered value
to an integer which is monotonically increasing: it is then never
possible to incorrectly determine that a previous pass through the
graph already considered the current target.

* filedef.h (struct file): make CONSIDERED an unsigned int.
* main.c (main): No longer need to reset CONSIDERED.
* remake.c (update_goal_chain): increment CONSIDERED rather than
inverting it between 0<->1.
(update_file_1): Reset CONSIDERED to 0 so it's re-considered.
(check_dep): Ditto.
* tests/scripts/features/double_colon: Add a regression test.
filedef.h
main.c
remake.c
tests/scripts/features/double_colon