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): reduce the scope where recursive expre...
details: https://anonhg.NetBSD.org/src/rev/9fcf08c13e02
branches: trunk
changeset: 945486:9fcf08c13e02
user: rillig <rillig%NetBSD.org@localhost>
date: Sat Oct 31 11:34:30 2020 +0000
description:
make(1): reduce the scope where recursive expressions are detected
Only the call to Var_Subst needs to be protected since the other
functions have nothing to do with expanding variables.
diffstat:
usr.bin/make/main.c | 6 +++---
usr.bin/make/var.c | 14 +++++---------
2 files changed, 8 insertions(+), 12 deletions(-)
diffs (75 lines):
diff -r 4bc4050dab9a -r 9fcf08c13e02 usr.bin/make/main.c
--- a/usr.bin/make/main.c Sat Oct 31 11:30:56 2020 +0000
+++ b/usr.bin/make/main.c Sat Oct 31 11:34:30 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: main.c,v 1.417 2020/10/31 09:35:58 rillig Exp $ */
+/* $NetBSD: main.c,v 1.418 2020/10/31 11:34:30 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -118,7 +118,7 @@
#include "trace.h"
/* "@(#)main.c 8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: main.c,v 1.417 2020/10/31 09:35:58 rillig Exp $");
+MAKE_RCSID("$NetBSD: main.c,v 1.418 2020/10/31 11:34:30 rillig Exp $");
#if defined(MAKE_NATIVE) && !defined(lint)
__COPYRIGHT("@(#) Copyright (c) 1988, 1989, 1990, 1993 "
"The Regents of the University of California. "
@@ -1827,7 +1827,7 @@
/* Produce a Fatal error message, then exit immediately.
*
- * If jobs are running, waits for them to finish. */
+ * If jobs are running, wait for them to finish. */
void
Fatal(const char *fmt, ...)
{
diff -r 4bc4050dab9a -r 9fcf08c13e02 usr.bin/make/var.c
--- a/usr.bin/make/var.c Sat Oct 31 11:30:56 2020 +0000
+++ b/usr.bin/make/var.c Sat Oct 31 11:34:30 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: var.c,v 1.614 2020/10/31 09:57:47 rillig Exp $ */
+/* $NetBSD: var.c,v 1.615 2020/10/31 11:34:30 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -129,7 +129,7 @@
#include "metachar.h"
/* "@(#)var.c 8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: var.c,v 1.614 2020/10/31 09:57:47 rillig Exp $");
+MAKE_RCSID("$NetBSD: var.c,v 1.615 2020/10/31 11:34:30 rillig Exp $");
#define VAR_DEBUG1(fmt, arg1) DEBUG1(VAR, fmt, arg1)
#define VAR_DEBUG2(fmt, arg1, arg2) DEBUG2(VAR, fmt, arg1, arg2)
@@ -3662,12 +3662,8 @@
free(varname);
}
- if (v->flags & VAR_IN_USE) {
+ if (v->flags & VAR_IN_USE)
Fatal("Variable %s is recursive.", v->name);
- /*NOTREACHED*/
- } else {
- v->flags |= VAR_IN_USE;
- }
/*
* Before doing any modification, we have to make sure the value
@@ -3683,13 +3679,13 @@
VarEvalFlags nested_eflags = eflags;
if (DEBUG(LINT))
nested_eflags &= ~(unsigned)VARE_UNDEFERR;
+ v->flags |= VAR_IN_USE;
(void)Var_Subst(nstr, ctxt, nested_eflags, &nstr);
+ v->flags &= ~(unsigned)VAR_IN_USE;
/* TODO: handle errors */
*freePtr = nstr;
}
- v->flags &= ~(unsigned)VAR_IN_USE;
-
if (haveModifier || extramodifiers != NULL) {
void *extraFree;
Home |
Main Index |
Thread Index |
Old Index