Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/make make(1): fix the other assertion from Lst_FindFrom



details:   https://anonhg.NetBSD.org/src/rev/4834d4476c14
branches:  trunk
changeset: 1013421:4834d4476c14
user:      rillig <rillig%NetBSD.org@localhost>
date:      Fri Aug 28 06:47:14 2020 +0000

description:
make(1): fix the other assertion from Lst_FindFrom

When I migrated the Lst_FindFrom to the strict API variant, I forgot
that Lst_FindFrom requires both arguments (list and node) to be
non-null.  I had only checked that the list is non-null.

There are only very few calls to Lst_FindFrom, and they are all ok now.

diffstat:

 usr.bin/make/meta.c |  9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diffs (23 lines):

diff -r ede7f28afaeb -r 4834d4476c14 usr.bin/make/meta.c
--- a/usr.bin/make/meta.c       Fri Aug 28 06:44:02 2020 +0000
+++ b/usr.bin/make/meta.c       Fri Aug 28 06:47:14 2020 +0000
@@ -1,4 +1,4 @@
-/*      $NetBSD: meta.c,v 1.106 2020/08/28 04:48:57 rillig Exp $ */
+/*      $NetBSD: meta.c,v 1.107 2020/08/28 06:47:14 rillig Exp $ */
 
 /*
  * Implement 'meta' mode.
@@ -1340,8 +1340,11 @@
                            char *tp;
 
                            do {
-                               nln = Lst_FindFrom(missingFiles, Lst_Succ(ln),
-                                                  path_match, p);
+                               LstNode succ = Lst_Succ(ln);
+                               nln = succ != NULL
+                                     ? Lst_FindFrom(missingFiles, succ,
+                                                    path_match, p)
+                                     : NULL;
                                tp = Lst_Datum(ln);
                                Lst_Remove(missingFiles, ln);
                                free(tp);



Home | Main Index | Thread Index | Old Index