Source-Changes-HG archive

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

[src/trunk]: src/usr.bin/make/unit-tests make(1): demonstrate bug in evaluati...



details:   https://anonhg.NetBSD.org/src/rev/732c6a0e9414
branches:  trunk
changeset: 1014718:732c6a0e9414
user:      rillig <rillig%NetBSD.org@localhost>
date:      Wed Sep 30 05:42:06 2020 +0000

description:
make(1): demonstrate bug in evaluation of indirect variable modifiers

Reported by sjg.

diffstat:

 usr.bin/make/unit-tests/varmod-l-name-to-value.exp |  5 ++++-
 usr.bin/make/unit-tests/varmod-l-name-to-value.mk  |  9 ++++++++-
 2 files changed, 12 insertions(+), 2 deletions(-)

diffs (31 lines):

diff -r 233fe1bb345b -r 732c6a0e9414 usr.bin/make/unit-tests/varmod-l-name-to-value.exp
--- a/usr.bin/make/unit-tests/varmod-l-name-to-value.exp        Wed Sep 30 05:04:54 2020 +0000
+++ b/usr.bin/make/unit-tests/varmod-l-name-to-value.exp        Wed Sep 30 05:42:06 2020 +0000
@@ -1,1 +1,4 @@
-exit status 0
+make: "varmod-l-name-to-value.mk" line 34: Malformed conditional (${value:${:UL}} == "")
+make: Fatal errors encountered -- cannot continue
+make: stopped in unit-tests
+exit status 1
diff -r 233fe1bb345b -r 732c6a0e9414 usr.bin/make/unit-tests/varmod-l-name-to-value.mk
--- a/usr.bin/make/unit-tests/varmod-l-name-to-value.mk Wed Sep 30 05:04:54 2020 +0000
+++ b/usr.bin/make/unit-tests/varmod-l-name-to-value.mk Wed Sep 30 05:42:06 2020 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: varmod-l-name-to-value.mk,v 1.3 2020/08/25 22:25:05 rillig Exp $
+# $NetBSD: varmod-l-name-to-value.mk,v 1.4 2020/09/30 05:42:06 rillig Exp $
 #
 # Tests for the :L modifier, which returns the variable name as the new value.
 
@@ -27,5 +27,12 @@
 .error
 .endif
 
+# Between 2020-09-22 (var.c 1.527) and 2020-09-30 (var.c 1.554), there was
+# a bug in the evaluation of variable expression.  Indirect modifiers like
+# this :L did not update the definedness of the enclosing expression.
+# This resulted in a wrong "Malformed variable".
+.if ${value:${:UL}} == ""
+.endif
+
 all:
        @:;



Home | Main Index | Thread Index | Old Index